A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, using helm/chart-releaser CLI tool.
- A GitHub repo containing a directory with your Helm charts (eg:
/charts
) - A GitHub branch called
gh-pages
to store the published charts. Seecharts_repo_url
for alternatives - Create a workflow
.yml
file in your.github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file
version
: The chart-releaser version to use (default: v1.2.1)config
: Optional config file for chart-releaser. For more information on the config file, see the documentationcharts_dir
: The charts directorycharts_repo_url
: The GitHub Pages URL to the charts repo (default:https://<owner>.github.io/<project>
)
CR_TOKEN
(required): The GitHub token of this repository (${{ secrets.GITHUB_TOKEN }}
)
For more information on environment variables, see the documentation.
Create a workflow (eg: .github/workflows/release.yml
):
name: Release Charts
on:
push:
branches:
- main
jobs:
release:
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 "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.1
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
This uses @helm/chart-releaser-action to turn your GitHub project into a self-hosted Helm chart repo.
It does this – during every push to main
– 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 an index.yaml
file with metadata about those releases, which is then hosted on GitHub Pages
workflow.yml
:
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
with:
charts_dir: charts
config: cr.yaml
charts_repo_url: xxxxxx
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
cr.yaml
:
owner: myaccount
git-base-url: https://api.github.com/
For options see config-file.
Participation in the Helm community is governed by the Code of Conduct.