Skip to content

Commit acbc5b7

Browse files
committed
Reuse metadata for test builds
And don't add 'latest' tag manually - the action adds it automatically
1 parent a3fcf3c commit acbc5b7

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ jobs:
1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@v3
2020

21+
- name: Generate Metadata
22+
id: meta
23+
uses: docker/metadata-action@v5
24+
with:
25+
images: ghcr.io/${{ github.repository }}
26+
tags: |
27+
type=semver,pattern={{version}}
28+
2129
- name: Build image
2230
uses: docker/build-push-action@v6
2331
env:
@@ -26,7 +34,7 @@ jobs:
2634
context: .
2735
cache-from: type=gha
2836
cache-to: type=gha
29-
tags: ci_test
37+
tags: ${{ steps.meta.outputs.tags }}
3038
load: true
3139

3240
- name: Login to GHCR
@@ -37,15 +45,6 @@ jobs:
3745
username: ${{ github.actor }}
3846
password: ${{ secrets.GITHUB_TOKEN }}
3947

40-
- name: Generate Metadata
41-
id: meta
42-
uses: docker/metadata-action@v5
43-
with:
44-
images: ghcr.io/${{ github.repository }}
45-
tags: |
46-
type=ref,event=tag
47-
type=raw,value=latest
48-
4948
- name: Publish image
5049
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
5150
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)