Skip to content

Commit e910466

Browse files
committed
ci: tag server Docker image with version from package.json alongside :latest
1 parent 28a5b04 commit e910466

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,23 @@ jobs:
2121
username: ${{ github.actor }}
2222
password: ${{ secrets.GITHUB_TOKEN }}
2323

24+
- name: Extract version
25+
id: version
26+
run: echo "tag=$(node -p "require('./packages/client/package.json').version")" >> $GITHUB_OUTPUT
27+
2428
- name: Build and push
2529
uses: docker/build-push-action@v5
2630
with:
2731
context: .
2832
file: packages/server/Dockerfile
2933
push: true
30-
tags: ghcr.io/a-saed/datum-server:latest
34+
tags: |
35+
ghcr.io/a-saed/datum-server:latest
36+
ghcr.io/a-saed/datum-server:${{ steps.version.outputs.tag }}
3137
3238
- name: Deploy to Fly.io
3339
uses: superfly/flyctl-actions@1.5
3440
with:
35-
args: deploy --image ghcr.io/a-saed/datum-server:latest
41+
args: deploy --image ghcr.io/a-saed/datum-server:${{ steps.version.outputs.tag }}
3642
env:
3743
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

0 commit comments

Comments
 (0)