Skip to content

Commit f9270f2

Browse files
committed
chore: Tag docker with version
1 parent 28924cb commit f9270f2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
1013
- name: Login to GitHub Container Registry
1114
uses: docker/login-action@v2
1215
with:
1316
registry: ghcr.io
1417
username: ${{ github.actor }}
1518
password: ${{ secrets.GITHUB_TOKEN }}
1619

20+
- name: Read package version
21+
id: pkg
22+
run: echo "version=$(node -p \"require('./package.json').version\")" >> "$GITHUB_OUTPUT"
23+
1724
- name: Build and push ghcr.io
1825
id: build-and-push
1926
uses: docker/build-push-action@v3.1.0
2027
with:
28+
context: .
2129
push: true
22-
tags: ghcr.io/${{ github.repository }}:latest
30+
tags: |
31+
ghcr.io/${{ github.repository }}:${{ steps.pkg.outputs.version }}
32+
ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)