Full hosting on GitHub Pages, automatic static build via actions

I recently came across the plugin kirby3-static-site-generator and had a thought: what if you could run the build process for the site in a GitHub action? I had just learned you can update the repo content itself from actions, so this made (some) sense. If you build the static site in ./docs, you could even host it on GitHub pages!

I spent some time to set it up, but it seems to be working (?)
You can’t use the panel, obviously, but as an academic exercise I find it fascinating. Whenever you push changes to the repo, the static version of the site gets rebuilt.

I have not spent much time with the details, but I guess this could be … cool? I have seen a few people ask about GitHub Pages hosting, so it could be an option, especially with GitHub’s editor capabilities getting better over time.

One thing you should be aware of is that there are no secrets inside the repo. You can’t store credentials or licenses, as they will be visible to all. I was wondering, whether there is a way you could sign the installation with a Kirby license key, so when you actually use it (eg. with a custom Domain, as full, public website), it can be verified by Kirby staff as a legit copy. Don’t know if that’s possible right now, but could be interesting to, let’s say, include a signature as meta element. That could be filled in during the build step with a license key stored in the Repo secrets (so it’s not public, but can be used for signing?)

Anyway, this can probably be done better, or even set up as a GitHub template, I just wanted to put it out there so smarter people can either do something with it, or tell me why I’m dumb.

Enjoy! (And buy a Kirby license if you use it!)

3 Likes

I guess you don’t need to include the license in the source code. I think you can still register the domain from the license app:

  1. you click on a license key
  2. enter the domain name
  3. download the license.

I think that this registers it even if you don’t actually ever put it into Kirby.

Good to know! It sounds like it would work.