Skip to content

Commit ae2c273

Browse files
committed
ci: Refactor how/when helm chart releases trigger
Make it part of the CI chain, not its own workflow
1 parent df23fce commit ae2c273

3 files changed

Lines changed: 41 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ jobs:
2424
contents: read
2525
id-token: write
2626
packages: write
27+
helm:
28+
# Only release the helm chart once images have been successfully pushed
29+
needs: images
30+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
31+
uses: ./.github/workflows/helm-release-reusable.yml
32+
permissions:
33+
contents: read
34+
packages: write
35+
with:
36+
version: 0.0.0-master

.github/workflows/helm-from-master.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Reusable helm chart release workflow
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
version:
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
jobs:
16+
helm:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
steps:
20+
- uses: actions/checkout@v7
21+
with:
22+
ref: ${{ github.sha }}
23+
- uses: azure/setup-helm@v5.0.1
24+
- run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
25+
- name: Package and push
26+
run: |
27+
helm package charts/cmk-rustik \
28+
--version ${{ inputs.version }} \
29+
--app-version "sha-${{ github.sha }}"
30+
helm push cmk-rustik-${{ inputs.version }}.tgz \
31+
oci://ghcr.io/${{ github.repository_owner }}/charts

0 commit comments

Comments
 (0)