Finally switched to Github Pages custom domain
I finally moved my website to Github Pages with custom domain and SSL
Context
Previously I explained how I set up Hugo to work with Github Actions and Github Pages.
It worked out of the box with my previous repo set up for Github Pages (http://sledigabel.github.io).
There are several documentations on how to set it up with your custom domain. TL;DR: you have to set up a CNAME record in your custom domain name DNS manager and make it point to your github.io website.
This is great, but while the github.io domain works with SSL out of the box (using Let’s encrypt in the background to generate a certificate), it did not work with a custom domain because my repository was primarily set up for a github.io endpoint not a custom domain. Bottom line: the CNAME works and does its job but then the SSL certificate generated by Let’s encrypt has no knowledge of it and your browser righly assumes the certificate is invalid for the endpoint you’re trying to access it from.
In this instance, the endpoint is (blog.ledigabel.com) and I wanted to make this work.
Steps
I had to recreate a new repository for this specific new endpoint. The problem was the github page website was created before custom domains were a thing, and so it was upgraded using custom domain with the CNAME trick rather than properly setup.
I mainly followed the steps here. I also found this article very useful, more of a step-by-step walkthrough.
I’ll basically write a quick summary of the steps I took:
- Create a new repository
blog.ledigabel.com - Generate a static website with
Hugoand copy the files over to the new repository. - Add a
CNAMEfile with content: “blog.ledigabel.com” - In Settings, Add a custom domain name under “Github pages” and tick “Enforce HTTPS”.

- Update the master hugo repository (containing the templated files), remove the old submodule with the new one
- Update Github Actions to update the new repository
Conclusion
The word that comes to my mind is easy peasy. I was under the impression that, as it used to be the case, only repositories called *.github.io could be used as Github Pages, but virtually any one would do. I’m considering doing the same thing for my static about page now. Any repository can now be used to work as a static website. I can now see why people are using this all the time.