Skip to content

Commit b60d088

Browse files
authored
build: add docker tags (#150)
Overwrites default Docker tags, to include the appropriate versions: - When an image is published, it will tag that image with its current version (vx.y.z), it's major version number (vx) and latest - When an image is built on main, same logic applies. - When an image is built on a pr, the pr-PR_NUMBER tag is applied.
1 parent b0ab710 commit b60d088

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ runs:
4949
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
5050
with:
5151
images: ${{ inputs['image-name'] }}
52-
52+
tags: |
53+
type=semver,enable=true,pattern={{raw}}
54+
type=semver,enable=true,pattern={{major}},prefix=v
55+
type=semver,enable=true,pattern=latest
56+
type=ref,event=pr,prefix=pr-,enable=true
57+
type=ref,event=branch,branch=main,pattern={{raw}}
58+
type=ref,event=branch,branch=main,pattern={{major}},prefix=v
59+
type=ref,event=branch,branch=main,pattern=latest
5360
- name: Build Docker image
5461
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
5562
with:

0 commit comments

Comments
 (0)