Skip to content

Commit 96c8521

Browse files
Extract version from Dockerfile for tagging
1 parent cd36745 commit 96c8521

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ jobs:
2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v3
2626

27+
- name: Extract version from Dockerfile
28+
id: version
29+
run: |
30+
VERSION=$(grep -oP 'p\K[\d.]+' Dockerfile | tail -1)
31+
echo "version=v${VERSION}" >> $GITHUB_OUTPUT
32+
2733
- name: Build and push
2834
uses: docker/build-push-action@v5
2935
with:
3036
context: .
3137
push: true
3238
platforms: linux/amd64
3339
tags: |
34-
bitcryptic/pi-network-node:v22.1
40+
bitcryptic/pi-network-node:${{ steps.version.outputs.version }}
3541
bitcryptic/pi-network-node:latest

0 commit comments

Comments
 (0)