diff --git a/.github/workflows/charts-release-oci.yaml b/.github/workflows/charts-release-oci.yaml new file mode 100644 index 0000000..0d78687 --- /dev/null +++ b/.github/workflows/charts-release-oci.yaml @@ -0,0 +1,45 @@ +name: "Charts: Release to GHCR OCI" + +on: + push: + branches: [main] + +jobs: + release-charts: + name: Release charts + permissions: + contents: write + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v4 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + skip_upload: true + + - name: Push Charts to GHCR + run: | + for pkg in .cr-release-packages/*; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" oci://ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/chart + done