From d9748a563dfad217f521495bab886c0dd83fc2fd Mon Sep 17 00:00:00 2001 From: Somnath Chattaraj Date: Tue, 30 Jul 2024 20:14:12 +0530 Subject: [PATCH] Update deploy.yaml --- .github/workflows/deploy.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f5e6b4d..d1d2af0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -30,6 +30,11 @@ jobs: - name: Verify Pushed Image run: docker pull somnath910/statuscode1:latest # Replace with your Docker Hub username and repository + deploy: + runs-on: ubuntu-latest + needs: build-and-push + + steps: - name: Deploy to EC2 uses: appleboy/ssh-action@master with: @@ -37,6 +42,7 @@ jobs: username: ${{ secrets.SSH_USERNAME }} key: ${{ secrets.SSH_KEY }} script: | + sudo systemctl restart docker sudo docker pull somnath910/statuscode1:latest sudo docker stop web-app || true sudo docker rm web-app || true @@ -50,3 +56,5 @@ jobs: -e BREVO_PORT=${{ secrets.BREVO_PORT }} \ -p 3005:3000 \ somnath910/statuscode1:latest + sudo docker ps -a + sudo docker logs web-app