Method 1: Host on GitHub Pages using Chart Releaser Action (Recommended for a repository) This method automates the process of packaging, indexing, and publishing your charts via GitHub Actions to a dedicated gh-pages branch, which then serves as a Helm repository.
Set up the Repository: Create a public GitHub repository and clone it locally. Place your chart source files (including Chart.yaml) in a directory, commonly a /charts folder.
Enable GitHub Pages: Go to your repository's Settings > Pages. Under "Source", select "Deploy from a branch", choose the gh-pages branch, and click Save. (The action will create this branch later).
Configure GitHub Actions Workflow: In your repository, create a workflow file (e.g., .github/workflows/publish-charts.yml) to use the official Helm Chart Releaser Action. This action will:
Trigger on push to your main branch (e.g., main).
Package new charts.
Create GitHub releases.
Update the index.yaml file on the gh-pages branch.
A basic workflow example might look like this:
yaml
name: Publish Helm Charts
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
uses: helm/chart-releaser-action@v1
with:
charts_dir: charts
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push Changes: Commit and push your changes to the main branch. The workflow will run automatically and set up the gh-pages branch. Access the Repository: Your Helm chart repository will be available at a URL like https:<owner>.github.io/<repoName>/. Users can then add your repository using the Helm CLI: bash helm repo add my-repo https:<owner>.github.io/<repoName>/ helm install my-chart my-repo/my-chart-name