Release Helm Chart #11
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 Helm Chart | |
on: | |
push: | |
tags: | |
- 'chart-v*' | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.14.3 | |
- name: Build Helm dependencies | |
run: helm dependency build chart/ | |
- name: Package Helm chart | |
run: | | |
helm package chart/ | |
rm -rf chart/Chart.lock chart/charts/ | |
# move the packages to a directory to avoid issues | |
# when checking out to `gh-pages` | |
mkdir gh_ | |
mv *.tgz gh_ | |
- name: Push to gh-pages branch | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git fetch origin gh-pages:gh-pages | |
git checkout gh-pages | |
mv gh_/*tgz . | |
helm repo index . --url https://eth-cscs.github.io/firecrestspawner --merge index.yaml | |
NEW_BRANCH="update-helm-repo-$(date +%s)" | |
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV | |
git checkout -b $NEW_BRANCH | |
git add *.tgz index.yaml | |
git commit -m "update helm repo" | |
git push -u origin $NEW_BRANCH | |
- name: Create pull request | |
run: | | |
gh pr create -H $NEW_BRANCH -B gh-pages --title '[release-chart] Update Helm repo' --body 'Created by Github action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NEW_BRANCH: ${{ env.NEW_BRANCH }} |