feat: changed deploy.yml

This commit is contained in:
filippo-ferrari 2024-09-06 21:23:34 +02:00
parent 942966c5e9
commit 047b75786e

View file

@ -36,9 +36,11 @@ jobs:
- name: Upload docker-compose.yml to server - name: Upload docker-compose.yml to server
run: scp -o StrictHostKeyChecking=no docker-compose.yml ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera run: scp -o StrictHostKeyChecking=no docker-compose.yml ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera
- name: Deploy on server - name: Deploy on server - Change directory
run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF' run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera'
cd /home/${{ secrets.SSH_USER }}/munera
docker-compose down - name: Deploy on server - Stop Docker containers
docker-compose up --build -d run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera && docker-compose down'
EOF
- name: Deploy on server - Start Docker containers
run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera && docker-compose up --build -d'