From 279d05f1752c000d285adf713945756f8fa4db0d Mon Sep 17 00:00:00 2001 From: Shubham Prajapati Date: Thu, 21 Nov 2024 15:00:12 +0530 Subject: [PATCH 1/3] "Updated deploy.yml to remove pull request trigger, added deployment to development server, and modified existing production server deployment" --- .github/workflows/deploy.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 016c43b..d626b6f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,9 +4,7 @@ on: push: branches: - prod - pull_request: - branches: - - prod + - main jobs: next-build: @@ -52,9 +50,10 @@ jobs: rm -rf .env ghcr-push: - needs: next-build # Job depends on next-build(above) job + needs: next-build runs-on: ubuntu-latest steps: + # Deploy to Production server - name: Deploy on Production server if: github.ref == 'refs/heads/prod' uses: appleboy/ssh-action@v0.1.7 @@ -70,3 +69,20 @@ jobs: echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin sudo docker pull ghcr.io/myriadflow/webxr:prod sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:prod + + # Deploy to Development server + - name: Deploy on Development server + if: github.ref == 'refs/heads/main' + uses: appleboy/ssh-action@v0.1.7 + with: + host: ${{ secrets.DEV_REMOTE_SERVER_ADDRESS }} + username: ${{ secrets.SERVER_USERNAME }} + key: ${{ secrets.DEV_REMOTE_SERVER_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + pwd + cd ~ + sudo docker stop webxr && sudo docker rm webxr && sudo docker rmi ghcr.io/myriadflow/webxr:dev + echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin + sudo docker pull ghcr.io/myriadflow/webxr:dev + sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:dev From 59031115f8d22a18238f5ec6be0f011a1d7db413 Mon Sep 17 00:00:00 2001 From: Shubham Prajapati Date: Thu, 21 Nov 2024 15:10:37 +0530 Subject: [PATCH 2/3] "Update Docker image tag from 'dev' to 'main' in deploy workflow" --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d626b6f..4e190da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -82,7 +82,7 @@ jobs: script: | pwd cd ~ - sudo docker stop webxr && sudo docker rm webxr && sudo docker rmi ghcr.io/myriadflow/webxr:dev + sudo docker stop webxr && sudo docker rm webxr && sudo docker rmi ghcr.io/myriadflow/webxr:main echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin - sudo docker pull ghcr.io/myriadflow/webxr:dev - sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:dev + sudo docker pull ghcr.io/myriadflow/webxr:main + sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:main From 6fd8c54d2988827d46b07637117da60efd310f3f Mon Sep 17 00:00:00 2001 From: Shubham Prajapati Date: Thu, 21 Nov 2024 15:17:02 +0530 Subject: [PATCH 3/3] "Remove Docker Build GitHub workflow" --- .github/workflows/check_build.yml => build_check.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/check_build.yml => build_check.txt (100%) diff --git a/.github/workflows/check_build.yml b/build_check.txt similarity index 100% rename from .github/workflows/check_build.yml rename to build_check.txt