Skip to content

Commit

Permalink
Added GH workflow to create and publish Helm chart to GH Pages as hel…
Browse files Browse the repository at this point in the history
…m repository
  • Loading branch information
jriguera committed Mar 12, 2024
1 parent f657110 commit 59c5213
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Charts

on:
workflow_dispatch: { }
push:
branches:
- "main"

permissions: {}

# see https://github.com/helm/chart-releaser-action

jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
packages: write # needed for ghcr access

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
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/setup-helm@v4

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: "true"

- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
[ -z "${pkg:-}" ] && break
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" && echo '::warning:: helm push failed!'
done

0 comments on commit 59c5213

Please sign in to comment.