Example project to demo testing and hosting a chart repository with GitHub Pages and Actions.
master
supports Helm 3 only, i. e. both v1
and v2
API version charts are installable.
charts/example-v1
: Sample chart with API version v1charts/example-v2
: Sample chart with API version v2charts/dependencies-v1
: Simple chart with API version v1 to test dependencies from an external Charts repocharts/dependencies-v2
: Simple chart with API version v2 to test dependencies from an external Charts repo
You can automatically test and host your own chart repository with GitHub Pages and Actions by following these steps.
- A GitHub project to use for your Charts repo (a clean project is most straightforward, as there won't be release cluttering or possible
gh-pages
conflicts) - A branch to use for GitHub Pages (
gh-pages
is most straightforward, as it's the default and requires no configuration) - A project Secret named
CR_TOKEN
with the value of a GitHub personal access token- The token must have
repo
scope - The token's user must have write access to the project
- To mitigate risk you may wish to limit the token to a single project by creating a machine user
- Please note the personal access token is required because of an Actions bug, and will hopefully be unnecessary in the future
- The token must have
The above prerequisites must be complete before the steps below, or your charts' initial versions won't be released.
- Use the
master
branch for all of the below, if you wish to use the Actions workflow files as-is - Copy the
.github/workflows
files from this project to yours - Add your charts to a parent directory in the project (
/charts
is most straightforward, as it's the default. To change this see helm/chart-testing > configuration > chart-dirs) - Optional: To list your charts repo publicly on the Helm Hub, see Helm Hub > How To Add Your Helm Charts
- The Lint and Test Charts workflow uses @helm/kind-action GitHub Action to spin up a kind Kubernetes cluster, and @helm/chart-testing-action to lint and test your charts on every Pull Request and push
- The Release Charts workflow uses @helm/chart-releaser-action to turn your GitHub project into a self-hosted Helm chart repo. It does this – during every push to
master
– by checking each chart in your project, and whenever there's a new chart version, creates a corresponding GitHub release named for the chart version, adds Helm chart artifacts to the release, and creates or updates anindex.yaml
file with metadata about those releases, which is then hosted on GitHub Pages - You should now be able to add your charts repo with
helm repo add <owner> https://<owner>.github.io/<project>