test20 #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
deploy-master: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: self-hosted | |
environment: | |
name: 'main' | |
steps: | |
- name: instalar git | |
run: sudo yum install git -y | |
- name: instalar git | |
run: sudo yum install tar | |
- name: Eliminar antes de clonar | |
run : rm -rf ${{secrets.PATH}} | |
- name: Crear carpeta con día y hora | |
run: mkdir ${{secrets.PATH}} | |
- name: Ir a carpeta con día y hora | |
run: cd ${{secrets.PATH}} | |
- name: permisos en otra ruta | |
run: chmod 777 ${{secrets.PATH}} | |
- name: Clonar Repositorio | |
run: git clone https://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@github.com/Samuelcloud07/java-tomcat-maven-example.git ${{secrets.PATH}} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Setup Maven Action | |
uses: s4u/setup-maven-action@v1.8.0 | |
- name: version mvn | |
run: mvn -version | |
- name: entrar el projecto & build | |
run : | | |
cd /home/ec2-user/test/2023-07-03_19-48/java-tomcat-maven-example | |
mvn package | |
- name: Pasar el war | |
run : | | |
cp java-tomcat-maven-example.war /usr/local/tomcat/webapps/ | |