Skip to content

Commit

Permalink
Add environment variable to docker stack and deploy pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottminns committed Nov 15, 2024
1 parent 15a6b8b commit 5990ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: create env file
run: |
echo "GIT_COMMIT_HASH=${{ github.sha }}" >> envfile
- name: Docker Stack Deploy
uses: cssnr/stack-deploy-action@v1
with:
Expand All @@ -61,3 +65,4 @@ jobs:
host: zenful.site
user: deploy
ssh_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
env_file: ./envfile
2 changes: 1 addition & 1 deletion docker-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock

web:
image: ghcr.io/dreamsofcode-io/zenstats:baaf221054f44ec2b6d85f60e94b70a0619665be
image: ghcr.io/dreamsofcode-io/zenstats:${GIT_COMMIT_HASH:-latest}
labels:
- "traefik.enable=true"
- "traefik.http.services.web.loadbalancer.server.port=8080"
Expand Down

0 comments on commit 5990ac4

Please sign in to comment.