From 283b005be8ac161061b3a65257cb3d87e0eb98a0 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:06:23 +0800 Subject: [PATCH] add a semantic version tag to the Docker image --- .github/workflows/build-and-publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 4237f6f..fbc0976 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -23,9 +23,10 @@ jobs: with: images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }} tags: | - type=ref,event=branch - type=ref,event=tag - # set latest tag for master branch + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + # set 'latest' tag for main branch type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Build and push Docker image