fixe github action workflow #6
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: | |
branches: | |
- master | |
jobs: | |
release: | |
permissions: | |
contents: write # to push chart release and create a release (helm/chart-releaser-action) | |
runs-on: ubuntu-latest | |
outputs: | |
changed_charts: ${{ steps.chart-releaser.outputs.changed_charts }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Set up Helm | |
uses: azure/[email protected] | |
with: | |
version: v3.9.2 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
id: chart-releaser | |
env: | |
CR_TOKEN: "${{ github.token }}" | |
generate-page: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Needed to commit the generated file | |
needs: | |
- release | |
if: needs.release.outputs.changed_charts != '' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
fetch-depth: 0 | |
- name: Generate Helm Charts HTML | |
uses: ./.github/actions/generate-helm-html-index | |
with: | |
index-file: 'index.yaml' | |
output-file: 'index.html' | |
- name: Commit and Push | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add index.html | |
git commit -m "Update Helm charts page" || exit 0 # Don't fail if no changes | |
git push | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: | |
- generate-page | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |