From 6db219ffc183c7d5279d54c19716ae07465f2faf Mon Sep 17 00:00:00 2001 From: Paul Gabriel Date: Fri, 18 Oct 2024 11:19:58 +0200 Subject: [PATCH] feat: Automatically build tagged images if tag exists --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf4c6d9..5007e4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,3 +36,11 @@ jobs: --push \ --platform=linux/amd64,linux/arm64,linux/armhf \ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest -f ./Dockerfile ./ + - name: Also create tagged image if tag exists + if: startsWith(github.ref, 'refs/tags/') + run: | + TAG=${GITHUB_REF#refs/tags/} + docker buildx build \ + --push \ + --platform=linux/amd64,linux/arm64,linux/armhf \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG -f ./Dockerfile ./