Skip to content

Commit

Permalink
Fix docker release (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed May 17, 2024
1 parent aed7e66 commit 96bee3e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ on:
# Keep in mind the Docker tagging on the "metadata" step if you add new triggers
workflow_dispatch: # In case a repo contributor needs a specific docker tag built.
push:
tags: ['v*.*.*']
branches: [main]
release:
# Release logic:
# https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unpublished#release
types: [ created ] # GITHUB_REF == tag pushed with the release
#
types: [ released ] # GITHUB_REF == tag pushed with the release
pull_request:
paths:
- ".github/workflows/build-docker.yml"
Expand Down Expand Up @@ -55,7 +57,12 @@ jobs:
with:
images: |
ghcr.io/centrifuge/centrifuge-chain
${{ github.event_name != 'pull_request' && 'centrifugeio/centrifuge-chain' || ''}}
${{ (github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))) && 'centrifugeio/centrifuge-chain' || ''}}
# TAGS:
# v.X.Y.Z when pushing a git tag (or a release)
# latest when triggered by a release
# PRXYZ when triggered from a PR (testing)
# {BRANCH_NAME} when triggered from branch push
tags: |
type=semver,pattern={{raw}},prefix=${{ matrix.target == 'test' && 'test-' || '' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
Expand Down Expand Up @@ -105,12 +112,12 @@ jobs:
enable-url-completion: true

- name: Update GitHub release
if: github.event_name == 'release' && matrix.target == 'release'
if: github.event_name == 'release' && github.event.action == 'released' && matrix.target == 'release'
uses: softprops/action-gh-release@v1
with:
append_body: true
body: |
**Docker tags:**
**Docker tags (${{ env.NOW }}):**
${{ steps.meta.outputs.tags }}
- if: failure()
Expand Down

0 comments on commit 96bee3e

Please sign in to comment.