From 2f70c31bb1dad6d24472b987f3b24387d783a6c5 Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Mon, 14 Oct 2024 15:39:13 +0330 Subject: [PATCH] Force recreate on prodction deploy only scripts --- .github/workflows/main-deploy-only.yml | 23 +++++++++++++++++++++++ .github/workflows/main-publish-deploy.yml | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/main-deploy-only.yml diff --git a/.github/workflows/main-deploy-only.yml b/.github/workflows/main-deploy-only.yml new file mode 100644 index 000000000..5fbca1df7 --- /dev/null +++ b/.github/workflows/main-deploy-only.yml @@ -0,0 +1,23 @@ +name: main-deploy-only + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: SSH and Redeploy + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.PRODUCTION_HOST }} + username: ${{ secrets.PRODUCTION_USERNAME }} + key: ${{ secrets.PRODUCTION_PRIVATE_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + cd QAcc-BE + git checkout main + git pull + docker compose -f docker-compose-production.yml pull + docker compose -f docker-compose-production.yml up --force-recreate -d + docker image prune -a --force diff --git a/.github/workflows/main-publish-deploy.yml b/.github/workflows/main-publish-deploy.yml index d36f2ea99..a4bba2192 100644 --- a/.github/workflows/main-publish-deploy.yml +++ b/.github/workflows/main-publish-deploy.yml @@ -2,7 +2,7 @@ name: publish-deploy-main-branch on: workflow_dispatch: - + jobs: run-linters: name: Run linters @@ -66,5 +66,5 @@ jobs: git checkout main git pull docker compose -f docker-compose-production.yml pull - docker compose -f docker-compose-production.yml up -d + docker compose -f docker-compose-production.yml up --force-recreate -d docker image prune -a --force