Skip to content

Commit

Permalink
Set env vars before restarting Docker services
Browse files Browse the repository at this point in the history
  • Loading branch information
psiemens committed Jan 10, 2025
1 parent 78809e0 commit 3c3961f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
SSH_KEY: ${{ secrets.GCP_SSH_PRIVATE_KEY_STAGING }}
SSH_HOST: ${{ secrets.GCP_SSH_HOST_STAGING }}

- name: Update environment variables
run: ssh staging 'export $(gcloud secrets versions access latest --secret="ubyssey_env_configs" | xargs)'

- name: Set tag in docker-compose.yml
run: sed -i "s/\${TAG}/${{ github.ref_name }}/g" docker-compose.yml

Expand All @@ -84,4 +81,7 @@ jobs:
run: scp -r nginx staging:/opt/ubyssey.ca/nginx

- name: Restart services
run: ssh staging 'docker compose -f /opt/ubyssey.ca/docker-compose.yml -p ubyssey up -d'
run: ssh staging '
export $(gcloud secrets versions access latest --secret="ubyssey_env_configs" | xargs)
docker compose -f /opt/ubyssey.ca/docker-compose.yml -p ubyssey up -d
'

0 comments on commit 3c3961f

Please sign in to comment.