feat: changed deploy.yml

This commit is contained in:
filippo-ferrari 2024-09-06 21:35:03 +02:00
parent 15e9dce53d
commit 2a2aa1141a

View file

@ -27,8 +27,8 @@ jobs:
with: with:
ssh-private-key: ${{ secrets.SSH_KEY }} ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Clean deployment directory on server #- name: Clean deployment directory on server
run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'rm -rf /home/${{ secrets.SSH_USER }}/munera/*' # run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'rm -rf /home/${{ secrets.SSH_USER }}/munera/*'
- name: Upload JAR to server - name: Upload JAR to server
run: scp -o StrictHostKeyChecking=no target/munera-1.0-SNAPSHOT.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera run: scp -o StrictHostKeyChecking=no target/munera-1.0-SNAPSHOT.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera
@ -43,11 +43,6 @@ jobs:
run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera && docker-compose down' run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera && docker-compose down'
- name: Start Docker containers on server - name: Start Docker containers on server
env:
DB_ADDRESS: ${{ secrets.DB_ADDRESS }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
run: | run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'ENDSSH' ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'ENDSSH'
cd /home/${{ secrets.SSH_USER }}/munera cd /home/${{ secrets.SSH_USER }}/munera