Linking Helm Charts in GitHub pages to ArtifactHUB

Brad McCoy
3 min readOct 21, 2021

--

We recently had a requirement to use ArtifactHUB to reference our Helm charts. We wanted to share how we did it as there are many different ways such as hosting it on your own server.

Photo by JOHN TOWNER on Unsplash

We choose to have it in GitHub so it auto builds each time we update the Helm charts as it automates the process of updating versions and URLs and keeps it close to the source code.

What we will cover today:

  • Creating a gh-pages branch for your GitHub repo
  • Creating a GitHub Action for helm-chart-releaser
  • Linking the ArtifactHub repo to your GitHub pages URL

Creating a gh-pages branch for your GitHub repo

Creating this branch enables GitHub pages on this repo and can be found as follows: https://<repoOwner>.github.io/<repoName>/

This is required for ArtifactHUB to access your charts through the generated index.yaml file.

Creating a GitHub Action for helm-chart-releaser

Add a new GitHub action like below to enable the helm chart releaser action. Note you do not have to specify any variables or secrets the ones below are default. This action will execute the helm package and helm repo index commands, which produces the release artifacts and index.yaml needed to record metadata for ArtifactHUB.

code snippet here

Linking the ArtifactHub repo to your GitHub pages URL

Go to your artifacthub.io account or create one for free. Click on Control Panel

Click on ADD to add a new Repository.

Add the details as follows:

Notice the URL is pointing to our GitHub page which is created by the new gh-pages branch we made. ArtifactHUB knows to look for the index.yaml file that the GitHub action has produced in that branch. This contains the metadata to look for the release artifacts that contain the packaged helm charts.

Conclusion

We are happy with this way as it keeps everything source controlled, neat and tidy in one GitHub location. Remember to change the versions of your helm charts when you change them so this will automatically be reflected in ArtifactHUB.

--

--

Brad McCoy
Brad McCoy

Written by Brad McCoy

CD Foundation board member | CNCF Ambassador | Kubernetes Release team 1.28 comms lead

Responses (1)