From 2823d08c860b85547eb2ffff17c4ead2d218b171 Mon Sep 17 00:00:00 2001 From: Alex Garel Date: Thu, 8 Feb 2024 10:08:06 +0100 Subject: [PATCH] ci: restart staging backend on deploy So that off-web changes are visible --- .github/workflows/preprod-deploy.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preprod-deploy.yml b/.github/workflows/preprod-deploy.yml index 1a60c45b0f4d..cc3135bb27e8 100644 --- a/.github/workflows/preprod-deploy.yml +++ b/.github/workflows/preprod-deploy.yml @@ -15,11 +15,12 @@ concurrency: jobs: deploy: runs-on: ubuntu-latest + # same concurrency as off-server staging deployment environment: off-net concurrency: off-net steps: - name: Checkout git repository - uses: appleboy/ssh-action@v1.0.3 # v0.1.4 + uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} @@ -37,3 +38,17 @@ jobs: git fetch --depth 1 # Checkout current commit SHA git checkout -qf ${{ github.sha }} + # we need to restart staging backend to see deployed changes + - name: Restart staging backend + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + proxy_host: ${{ secrets.PROXY_HOST }} + proxy_username: ${{ secrets.USERNAME }} + proxy_key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + # Go to repository directory and restart backend + cd off-net + docker compose restart backend \ No newline at end of file