From 047b75786e3729748e392eee083daf97e9a29f72 Mon Sep 17 00:00:00 2001 From: filippo-ferrari Date: Fri, 6 Sep 2024 21:23:34 +0200 Subject: [PATCH] feat: changed deploy.yml --- .github/workflows/deploy.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 13f3009..038362d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,9 +36,11 @@ jobs: - 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 - - name: Deploy on server - run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF' - cd /home/${{ secrets.SSH_USER }}/munera - docker-compose down - docker-compose up --build -d - EOF + - name: Deploy on server - Change directory + run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera' + + - name: Deploy on server - Stop Docker containers + run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd /home/${{ secrets.SSH_USER }}/munera && docker-compose down' + + - 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'