Skip to content

Commit

Permalink
Merge pull request #536 from openfoodfacts/deploy-ci-restart-backend
Browse files Browse the repository at this point in the history
ci: restart staging backend on deploy
  • Loading branch information
teolemon authored Feb 12, 2024
2 parents 9905f1c + 2823d08 commit 0a91428
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/preprod-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected] # v0.1.4
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
Expand All @@ -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/[email protected]
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

0 comments on commit 0a91428

Please sign in to comment.