Skip to content

Commit

Permalink
fix(build): Use release-please output as tag value input for Docker…
Browse files Browse the repository at this point in the history
… tagging

There's an issue: the Docker metadata fetching requires a tag push event.
However, release-please doesn't work off tag push events but only (default) branch push events.
(At least that's what all the docs indicate).

The solution is to continue to ignore tag pushes (seems a bit unidiomatic though)
and instead continue to check for created releases and then use the provided output
of the released tag name (*even though it's a branch push event*).
  • Loading branch information
alexpovel committed Sep 4, 2022
1 parent a580ba9 commit 4b05181
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:

outputs:
created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
- uses: google-github-actions/release-please-action@v3
Expand Down Expand Up @@ -157,9 +158,9 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=semver,value=${{ needs.release-please.outputs.tag_name }},pattern={{version}}
type=semver,value=${{ needs.release-please.outputs.tag_name }},pattern={{major}}.{{minor}}
type=semver,value=${{ needs.release-please.outputs.tag_name }},pattern={{major}},enable=${{ !startsWith(needs.release-please.outputs.tag_name, 'v0.') }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
Expand Down

0 comments on commit 4b05181

Please sign in to comment.