Custom Helm Chart Releaser #36
Workflow file for this run
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: Release Charts | |
on: | |
push: | |
tag: | |
- 'v*.*.*' | |
jobs: | |
build: | |
name: Publish Helm Chart | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
CHART_NAME: fleet-scheduler | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.CHART_NAME }} | |
fetch-depth: 0 | |
- | |
name: Checkout Helm chart Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: metal-toolbox/fleet-scheduler | |
path: helm-charts | |
ref: gh-pages | |
fetch-depth: 0 | |
- | |
name: Install Helm | |
uses: azure/[email protected] | |
- | |
name: Package Helm Chart | |
run: | | |
sed -i "s/VERSION/${{ github.ref_name }}/g" ./${{ env.CHART_NAME }}/chart/Chart.yaml | |
helm package ./${{ env.CHART_NAME }}/chart -u -d ./helm-charts/ | |
helm repo index ./helm-charts/ --url https://metal-toolbox.github.io/helm-charts/ | |
- | |
name: Create Git Commit | |
run: | | |
cd helm-charts | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
git add index.yaml *.tgz | |
git commit -m "published ${{ env.CHART_NAME }}-${{ github.ref_name }}.tgz" | |
- | |
name: Push Changes | |
uses: ad-m/github-push-action@master | |
with: | |
repository: metal-toolbox/fleet-scheduler | |
directory: helm-charts | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages |