From 67ae25186e50dd558b8963ef3bbe097add4ba1c1 Mon Sep 17 00:00:00 2001 From: Maaike Date: Tue, 14 Jan 2025 09:58:42 +0100 Subject: [PATCH] set image tag based on release --- .github/workflows/build_and_publish_image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_publish_image.yml b/.github/workflows/build_and_publish_image.yml index ac0d67d..f4a127b 100644 --- a/.github/workflows/build_and_publish_image.yml +++ b/.github/workflows/build_and_publish_image.yml @@ -3,7 +3,7 @@ # separate terms of service, privacy policy, and support # documentation. -name: publish images to ghrc.io and docker-hub +name: Publish images to ghcr.io and Docker Hub on: push: @@ -58,8 +58,8 @@ jobs: ${{ env.DOCKER_ORG }}/${{ matrix.image }} ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=pep440,pattern={{version}} + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }} - name: Build and push uses: docker/build-push-action@v2.7.0 @@ -68,7 +68,7 @@ jobs: file: ./Dockerfile cache-from: type=gha cache-to: type=gha,mode=max - platforms: linux/arm64, linux/amd64 + platforms: linux/arm64,linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}