From 10602374f0dc2057aef2f661b75285c8dba19fea Mon Sep 17 00:00:00 2001 From: "Rieb, Elias" Date: Mon, 9 Dec 2024 11:22:29 +0100 Subject: [PATCH] chore(workflows): Fix release workflow --- .github/workflows/go.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index ee9c4ae..7df5ec7 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -43,19 +43,23 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - id: semantic-release - uses: go-semantic-release/action@v1 + - uses: go-semantic-release/action@v1 with: hooks: goreleaser prerelease: false allow-initial-development-versions: true # remove to trigger an initial 1.0.0 release changelog-generator-opt: "emojis=true" github-token: ${{ secrets.GITHUB_TOKEN }} - - if: steps.semantic-release.outputs.version != '' - run: | - TAG=${{ steps.semantic-release.outputs.version }} - IMAGE=${{ needs.build.outputs.image }} + - id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=semver,pattern={{version}} + - run: | + TARGET=${{ steps.meta.outputs.tags }} + SOURCE=${{ needs.build.outputs.image }} - docker pull $IMAGE - docker tag $IMAGE $IMAGE:$TAG - docker push $IMAGE:$TAG + docker pull $SOURCE + docker tag $SOURCE $TARGET + docker push $TARGET