Skip to content

Commit

Permalink
fix(ci): push from release event too and handle multiple tags
Browse files Browse the repository at this point in the history
we push latest and versioned tags here, need to handle that

also run `release-please` after releasing to update the new PR again
  • Loading branch information
iainlane committed Nov 8, 2024
1 parent b0c19fe commit 278f9c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
REGISTRY: ghcr.io
IMAGE: grafana/generate-policy-bot-config
PUSH_IMAGE: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || '' }}
PUSH_IMAGE: ${{ (github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) || '' }}

steps:
- name: Checkout
Expand Down Expand Up @@ -92,8 +92,12 @@ jobs:
- name: Extract platform-specific digests
if: env.PUSH_IMAGE
id: platform-digests
shell: bash
run: |
REGISTRY_REF="${{ steps.calculate-metadata.outputs.tags }}"
declare -a TAGS
TAGS=(${{ steps.calculate-metadata.outputs.tags }})
REGISTRY_REF="${TAGS[0]}"
BASE_REF="${REGISTRY_REF%%:*}"
# Get digests for each platform
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
branches:
- main

release:
types:
- published

permissions:
contents: write
pull-requests: write
Expand Down

0 comments on commit 278f9c9

Please sign in to comment.