change commit msg #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: 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 }} | |
chart_version: ${{ steps.chart-releaser.outputs.chart_version }} | |
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 "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Set up Helm | |
uses: azure/setup-helm@v3.5 | |
with: | |
version: v3.9.2 | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.6.0 | |
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 "$GITHUB_ACTOR" | |
git config --local user.name "$GITHUB_ACTOR@users.noreply.github.com" | |
git add index.html | |
git commit -m "Update Helm charts page version ${{ needs.release.outputs.changed_charts }}" || 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 |