From 94711072a77921beffdbbcb10c44d92fdf9391c8 Mon Sep 17 00:00:00 2001 From: Oliver Domokos Date: Thu, 17 Oct 2024 11:32:20 +0200 Subject: [PATCH] feat: add OCI registry support for Helm chart --- .github/workflows/release.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9eed6475..df6fed24 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: branches: - master paths: - - 'charts/**' + - "charts/**" jobs: release: @@ -27,5 +27,20 @@ jobs: - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 env: - CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_SKIP_EXISTING: true + - name: Login to GHCR + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push charts to GHCR + run: | + shopt -s nullglob + for pkg in .cr-release-packages/*.tgz; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts" + done