test sin mvn #57
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 tar | |
# run: sudo yum install tar -y | |
- 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: checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
#- name: Configurar el entorno | |
# uses: actions/setup-act@v3 | |
# with: | |
# platform: 'amazonlinux-latest' | |
#- name: Instalar tar | |
# run: sudo yum install tar -y | |
#- name: Set up Maven | |
# uses: aahmed-se/setup-maven@v3 | |
#with: | |
# maven-version: 3.8.2 | |
#- 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/ | |