name: Release Charts on: push: branches: - main jobs: release: permissions: contents: write packages: write runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm id: install uses: azure/setup-helm@v4.2.0 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 with: skip_existing: true 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: | if [ -d ".cr-release-packages" ]; then for pkg in .cr-release-packages/*; do if [ -z "${pkg:-}" ]; then break fi helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts done else echo "Directory .cr-release-packages does not exist." fi