How to add a custom domain to a GitHub Page
Hi everyone, in this article I want to show you how to add a custom domain to a GitHub Page when you want to level up your (side)project with a domain name. I discovered these steps last week when I register a domain for one of my sideproject which is hosted on a GitHub Page, some steps are related to GitHub others to your domain and in particular the DNS.
In your GitHub repo go to the Settings tab, scroll down until you reach GitHub Pages -> Custom domain, and insert here your custom domain name, in my case it's covid19trackerita.it
Create in you repo a CNAME file and insert the same domain name
On your domain provider, you have to change some configuration about your DNS. You have to create four A records and one CNAME record
The dot at the end of all domain names is mandatory otherwise the configuration will not work.
Now you have to wait some hours, at most one day, and you will be able to access your GitHub Page using your custom domain.
When all it's OK you can also add an SSL Certificate to your web page, in your GitHub repo go to the Settings tab, scroll down until you reach GitHub Pages -> Enforce HTTPS and enable it!
Simple, isn't it? Alberto