From 3f6249e2c499121b520625c7cb20384754db62fd Mon Sep 17 00:00:00 2001 From: Thomas Misilo Date: Thu, 12 Feb 2026 11:22:05 -0600 Subject: [PATCH] feat(resuable-docker-build): adding semver image type for docker tags --- .github/workflows/reusable-docker-build.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index fcfe974..a3da20e 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -54,16 +54,24 @@ env: # For a new commit on other branches, use the branch name as the tag for Docker image. # For a new tag, copy that tag name as the tag for Docker image. IMAGE_TAGS: | - type=raw,value=latest,enable=${{ github.ref_name == github.event.repository.default_branch }} - type=ref,event=branch,enable=${{ github.ref_name != github.event.repository.default_branch }} + # Latest tag for default branch + type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} + type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }} + + # Git tag push type=ref,event=tag + + # PR builds type=raw,value=pr-${{ github.event.pull_request.number }},enable=${{ github.event_name == 'pull_request' }} + + # Tag from workflow_run override + type=raw,value=${{ inputs.tags_flavor }},enable=${{ inputs.tags_flavor != '' }} + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + # Define default tag "flavor" for docker/metadata-action per # https://github.com/docker/metadata-action#flavor-input - # We manage the 'latest' tag ourselves to the 'main' branch (see settings above) - TAGS_FLAVOR: | - latest=false - ${{ inputs.tags_flavor }} + TAGS_FLAVOR: ${{ inputs.tags_flavor || 'latest=false' }} jobs: docker-build: