-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #536 from openfoodfacts/deploy-ci-restart-backend
ci: restart staging backend on deploy
- Loading branch information
Showing
1 changed file
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -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 |