Skip to content

Commit d4380f0

Browse files
authored
build: add tag with major version (#389)
Add a tag to the built Docker image with its associated major version number. This will allow users to get minor and patch updates for free without having to manually change anything in their pipelines. i.e. if the current version was `v1.2.3`, we're now adding a new `v1` tag, along with all the previous ones (`v1.2.3`, `latest`). closes #388
1 parent 1aa8f5d commit d4380f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/actions/docker-build/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ runs:
6464
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
6565
with:
6666
images: ${{ inputs['image-name'] }}
67+
tags: |
68+
type=semver,enable=true,pattern={{raw}}
69+
type=semver,enable=true,pattern={{major}},prefix=v
70+
type=ref,event=pr,prefix=pr-,enable=true
71+
type=ref,event=branch,branch=main,pattern={{raw}}
72+
type=ref,event=branch,branch=main,pattern={{major}},prefix=v
6773
6874
- name: Build Docker image
6975
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

0 commit comments

Comments
 (0)