Add Helm chart publishing workflow #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Publish Helm Chart | |
| permissions: | |
| contents: read | |
| on: | |
| release: | |
| types: | |
| - published | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v*.*.* | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**/*.md' | |
| types: [labeled, unlabeled, opened, synchronize, reopened] | |
| jobs: | |
| publish-charts: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ok-to-chart') | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4.3.0 | |
| with: | |
| version: v3.16.2 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Set charts version | |
| if: github.event_name == 'push' | |
| run: | | |
| sed -i "s/version: .*/version: ${GITHUB_REF_NAME#v}/" dist/chart/Chart.yaml | |
| - name: Move crds folder out of templates | |
| run: mv dist/chart/templates/crd dist/chart/crds | |
| - name: Run chart-releaser | |
| uses: afritzler/helm-oci-charts-releaser@enh/skip-gh-release | |
| # uses: bitdeps/helm-oci-charts-releaser@v0.1.3 | |
| with: | |
| charts_dir: dist/chart | |
| oci_registry: ghcr.io/${{ github.repository_owner }}/charts | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| oci_password: ${{ secrets.GITHUB_TOKEN }} | |
| oci_username: ${{ github.actor }} | |
| skip_gh_release: true |