Skip to content

Commit 6f30136

Browse files
ci: Release helm charts as OCI artifact (nerdswords#48)
* ci: Release helm charts as OCI artifact Helm supports helm charts as OCI artifact, too. This has the great benefit that a local configuration of a helm repo is not longer necessary. Ref: prometheus-community/helm-charts@17736ad/.github/workflows/release.yaml#L45C1-L61C15 * Add packages permission --------- Co-authored-by: Cristian Greco <[email protected]>
1 parent b888c22 commit 6f30136

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: .github/workflows/release.yml

+19
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
if: github.repository == 'nerdswords/helm-charts'
1212
permissions:
1313
contents: write
14+
packages: write # needed for ghcr access
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout
@@ -34,6 +35,24 @@ jobs:
3435
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3536
CR_RELEASE_NAME_TEMPLATE: "yace-helm-chart-{{ .Version }}"
3637

38+
# see https://github.com/helm/chart-releaser/issues/183
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Push charts to GHCR
47+
run: |
48+
shopt -s nullglob
49+
for pkg in .cr-release-packages/*; do
50+
if [ -z "${pkg:-}" ]; then
51+
break
52+
fi
53+
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
54+
done
55+
3756
sync-readme:
3857
needs: [release]
3958
permissions:

0 commit comments

Comments
 (0)