From 8a0590c45505740ece47725b479f7952b8613e7e Mon Sep 17 00:00:00 2001 From: Shubham Prajapati Date: Thu, 21 Nov 2024 15:22:36 +0530 Subject: [PATCH] "Remove check_build.yml workflow and add deployment to development server in deploy.yml" --- .github/workflows/deploy.yml | 17 +++++++++++++++++ .../check_build.yml => check_build.txt | 0 2 files changed, 17 insertions(+) rename .github/workflows/check_build.yml => check_build.txt (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 96a6f68..6db4a34 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -70,3 +70,20 @@ jobs: echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin sudo docker pull ghcr.io/myriadflow/studio:prod sudo docker run --name="studio" -p 9080:3000 -d ghcr.io/myriadflow/studio:prod + + - name: Deploy on Developent 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 studio && sudo docker rm studio && sudo docker rmi ghcr.io/myriadflow/studio:main + echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin + sudo docker pull ghcr.io/myriadflow/studio:main + sudo docker run --name="studio" -p 9080:3000 -d ghcr.io/myriadflow/studio:main + diff --git a/.github/workflows/check_build.yml b/check_build.txt similarity index 100% rename from .github/workflows/check_build.yml rename to check_build.txt