Custom domain site hosted on Github

2 minutes

Update on June 7, 2018: I’ve moved my website over to GitLab pages from GitHub pages. On the way, I got a pleasant surprise with the integrated CI/CD, which made it really easy to replace my release script (shown below) with a job configuration that handles build and release in the same repository, nice and easy. So to make an update all I have to do now is push to git.

This website used is hosted on github. It’s free, fast and reliable. You can only host static websites on github, but that’s not an issue if you use static site generator like Jekyll, or if you, like me, prefer using Haskell, there’s Jekyll’s good twin Hakyll.

To redirect your custom domain to the github page, you need to lookup the DNS for A Record IP, using either dig command or online DNS lookup tool. Then use the IP address you found to create A Record for your domain. Consult the github documentation if you need more details.

To redirect the github page to your custom domain create a CNAME file in the github pages repo and put your domain name in it.

It is handy to create a one-click publish shell script. Here is mine: