From 7ef9209386851220e1c38c4909007e03b412292c Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Fri, 22 Nov 2024 17:11:29 +0100 Subject: [PATCH] feat(helm): publish OCI helm charts Signed-off-by: Ludovic Ortega --- .github/workflows/release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a00ad4..8618e9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,3 +23,22 @@ jobs: uses: helm/chart-releaser-action@v1.4.1 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + 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/*; do + if [ -z "${pkg:-}" ]; then + break + fi + lowercase=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') + echo "Pushing package - ${pkg} to ghcr.io repository - ${lowercase}" + helm push "${pkg}" "oci://ghcr.io/${lowercase}" + done