11name : Push Helm Chart
22
3+ # TODO: fix: workflows have a problem where only code owners' PRs get the actions running
4+
35on :
46 pull_request :
57 types :
911 paths :
1012 - ' deployments/kubernetes/chart/reloader/**'
1113 - ' .github/workflows/push-helm-chart.yaml'
14+ - ' .github/workflows/release-helm-chart.yaml'
1215
1316env :
1417 HELM_REGISTRY_URL : " https://stakater.github.io/stakater-charts"
15- REGISTRY : ghcr.io
18+ REGISTRY : ghcr.io # container registry
1619
1720jobs :
1821 verify-and-push-helm-chart :
1922
2023 permissions :
2124 contents : read
22- packages : write # to push artifacts to `ghcr.io`
25+ id-token : write # needed for signing the images with GitHub OIDC Token
26+ packages : write # for pushing and signing container images
2327
2428 name : Verify and Push Helm Chart
2529 if : ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'release/helm-chart')) }}
2630 runs-on : ubuntu-latest
2731
2832 steps :
2933 - name : Check out code
30- uses : actions/checkout@v4
34+ uses : actions/checkout@v5
3135 with :
3236 token : ${{ secrets.PUBLISH_TOKEN }}
3337 fetch-depth : 0 # otherwise, you will fail to push refs to dest repo
6872 echo "Helm Chart Version wasnt updated"
6973 exit 1
7074
75+ - name : Install Cosign
76+ uses : sigstore/cosign-installer@v4.0.0
77+
7178 - name : Login to GHCR Registry
7279 uses : docker/login-action@v3
7380 with :
8188 helm push ./packaged-chart/*.tgz oci://ghcr.io/stakater/charts
8289 rm -rf ./packaged-chart
8390
91+ - name : Sign artifacts with Cosign
92+ run : cosign sign --yes ghcr.io/stakater/charts/reloader:${{ steps.new_chart_version.outputs.result }}
93+
8494 - name : Publish Helm chart to gh-pages
8595 uses : stefanprodan/helm-gh-pages@master
8696 with :
@@ -95,6 +105,13 @@ jobs:
95105 commit_username : stakater-user
96106 commit_email : stakater@gmail.com
97107
108+ - name : Push new chart tag
109+ uses : anothrNick/github-tag-action@1.75.0
110+ env :
111+ GITHUB_TOKEN : ${{ secrets.PUBLISH_TOKEN }}
112+ WITH_V : false
113+ CUSTOM_TAG : chart-v${{ steps.new_chart_version.outputs.result }}
114+
98115 - name : Notify Slack
99116 uses : 8398a7/action-slack@v3
100117 if : always() # Pick up events even if the job fails or is canceled.
0 commit comments