chore: bump version (#6) #5
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: Publish Helm Chart | |
| on: | |
| push: | |
| branches: | |
| - main | |
| repository_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v3 | |
| with: | |
| version: v3.13.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install PyYAML | |
| run: pip install PyYAML | |
| - name: Prepare chart | |
| run: | | |
| mkdir -p public | |
| if git ls-remote --exit-code origin gh-pages; then | |
| git fetch origin gh-pages | |
| # Attempt to get the old index, but don't fail if it doesn't exist or gh-pages branch is empty | |
| git show origin/gh-pages:index.yaml > public/index.yaml || echo "No existing index.yaml found or gh-pages is empty." | |
| fi | |
| # Loop through each directory in charts/ and package it | |
| for chart_dir in charts/*/; do | |
| if [ -d "$chart_dir" ]; then | |
| echo "Packaging chart in $chart_dir" | |
| helm package "$chart_dir" -d public | |
| fi | |
| done | |
| if [ -f public/index.yaml ] && [ -s public/index.yaml ]; then # Check if index.yaml exists and is not empty | |
| helm repo index public --url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" --merge public/index.yaml | |
| else | |
| helm repo index public --url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" | |
| fi | |
| - name: Generate static HTML page | |
| run: python .github/scripts/generate_static_html.py | |
| - name: Publish | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| publish_branch: gh-pages | |
| keep_files: true |