Merge pull request #2 from moveaxlab/helm-test #8
This file contains 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: Publish Helm Chart | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
changes: | |
permissions: | |
contents: read # for dorny/paths-filter to fetch a list of changed files | |
pull-requests: read # for dorny/paths-filter to read pull requests | |
runs-on: ubuntu-latest | |
outputs: | |
charts: ${{ steps.filter.outputs.charts }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: dorny/[email protected] | |
id: filter | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filters: | | |
charts: | |
- 'charts/metadata-injector/Chart.yaml' | |
- 'charts/metadata-injector/values.yaml' | |
chart: | |
name: Release Chart | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # needed to write releases | |
needs: | |
- changes | |
if: | | |
needs.changes.outputs.charts == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Fetch entire history. Required for chart-releaser; see https://github.com/helm/chart-releaser-action/issues/13#issuecomment-602063896 | |
fetch-depth: 0 | |
- name: Setup | |
shell: bash | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
- name: Helm Chart Releaser | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" | |
with: | |
charts_dir: charts |