From f7ecde67bfc72243c156f1036caf6c1376b307f6 Mon Sep 17 00:00:00 2001 From: xeptore <29199390+xeptore@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:26:54 +0330 Subject: [PATCH] set docker image tag from git tag Signed-off-by: xeptore <29199390+xeptore@users.noreply.github.com> --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b440e98..f0e59ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: branches: - main tags: - - "v*.*.*" + - "v[0-9]+.[0-9]+.[0-9]+" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -50,12 +50,17 @@ jobs: images: | ghcr.io/${{ github.repository }}/ingest tags: | - type=edge + type=edge,enable=${{ github.event_name == 'push' && github.ref_protected && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} labels: | maintainer=${{ github.repository_owner }} org.opencontainers.image.authors=${{ github.repository_owner }} flavor: | - latest=true + latest=${{ github.ref_type != 'tag' && !startsWith(github.ref, 'refs/tags/') }} + prefix=,onlatest=false + suffix=,onlatest=false - name: Setup Docker Buildx uses: docker/setup-buildx-action@v2 with: