From 750566828aa82d95f780d124c4cdd92da5d31a42 Mon Sep 17 00:00:00 2001 From: Howard <139238193+howard-oc@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:25:20 +0100 Subject: [PATCH 1/2] ci(docker): :rocket: test semver tag --- .github/workflows/docker-publish.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3ae1ba9..6063d9f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -36,6 +36,21 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer @@ -68,7 +83,11 @@ jobs: uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image From 098bb937b84dbc1573e59727f03017f77137e467 Mon Sep 17 00:00:00 2001 From: Howard <139238193+howard-oc@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:27:31 +0100 Subject: [PATCH 2/2] fix:bug: contents write needed --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6063d9f..f2af0c6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest permissions: - contents: read + contents: write packages: write # This is used to complete the identity challenge # with sigstore/fulcio when running outside of PRs.