Skip to content

Commit

Permalink
Create Helm Chart Release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Polchenko <[email protected]>
  • Loading branch information
i5okie committed Sep 19, 2023
1 parent 54d6413 commit ceb83dc
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/chart_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Helm Chart Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
# Sometimes chart-releaser might fetch an outdated index.yaml from gh-pages, causing a WAW hazard on the repo
# This job checks the remote file is up to date with the local one on release
validate-gh-pages-index:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download remote index file and check equality
run: |
curl -vsSL https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/index.yaml > index.yaml.remote
LOCAL="$(md5sum < index.yaml)"
REMOTE="$(md5sum < index.yaml.remote)"
echo "$LOCAL" = "$REMOTE"
test "$LOCAL" = "$REMOTE"
chart-release:
name: Create chart release
runs-on: ubuntu-latest
needs: [ validate-gh-pages-index ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Add bitnami repository
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: ./.github/actions/chart_releaser
with:
config: .github/actions/chart_releaser/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit ceb83dc

Please sign in to comment.