Today, I want to share what I did with a customer to make his GitHub repo become an automated HTTP Helm Chart repo. This is a very good choice, since there’s a GitHub Action that we can use to keep the repo index updated automatically. Buckle up!
Tutorial
Requirements
A GitHub Account, and some Helm Chart dummies.
First Step
Let’s create a super simple GitHub Repo/Project:
Second Step
Now, let’s create a branch called gh-pages. I’m already at the UI, so I won’t clone/checkout right now.
Third Step
Let’s follow the Chart Repository Guide to make sure our repo is ready for hosting the Helm Chart Repo. You’ll want to make sure your gh-pages branch is set as GitHub Pages. Click on your repo Settings, scroll down to GitHub pages section, and set as per below:
This process creates or updates an index.yaml in the gh-pages branch. So, let’s use this trick to make sure the Action is working.
Fifth Step
Now it’s time to add our chart source path, push the project to its origin, and pray for the best. I found the Helm documentation about this part a little poor, and that’s one of the reasons I’m writing this article.
This is our current state:
Let’s create the path that will host my very simple and dummy NGINX Helm Chart Source, and then I’ll add the very nice Helm Chart I have:
mkdir charts
This is a Helm Source that I got by following the tutorial on the documentation. I didn’t change anything.
Let’s just add a random version in the Chart.yaml, to make sure it’s working:
Sixth Step
Nice! Time to push that to our origin!
Seventh Step
Let’s just make sure this is working.
I’ll take a look at the GitHub Action tab. Looks solid to me:
I don’t believe in it. I’ll test it again; version #14 now!
It works!
Important: you can also check that the Action is handling well our index.yaml, in the gh-pages branch. This file is super important to any HTTP Repo, right?