Hosting a site on GitHub Pages with custom domain and free SSL
GitHub pages is a great place for hosting a static website. It’s easy to add a custom domain name too by pointing the domain name’s name servers to GitHub’s and add a CNAME file to the root of your site and you’re done. If you use a custom domain name though you can’t have the site served over HTTPS by default.
Cloudflare is a great CDN with a generous free-tier which offers free SSL. You can use it with GitHub pages and have your pages served over HTTPS.
Sign up for an account at Cloudflare.com
Add your domain name to Cloudflare
From your domain registrars site change the nameservers of your domain name to point to Cloudflare
Change the A records of your domain to point to GitHub, mine are * points to 220.127.116.11 and christianoliff.com points to 18.104.22.168.
Wait a short while - and you’re done!
Once you’re all setup there’s a range of settings and controls in the Cloudflare admin, and paid-upgrades to premium features available. I recommend setting the ‘Always use HTTPS’ and ‘Automatic HTTPS Rewrites’ options to On (crypto tab).
There are a couple of limitations to be aware of;