Full guideline for using custom domain to any github repository.
Open your repositoy and click on Settings
Under the Github Pages -> Source, click on None
, then select master
or another branch, then Save
it
This will publish your project with github-pages via selected branch. So, your site is live now at https://username.github.io/projectname. Now we will set custom domain to our github project. But before that we will edit our main domain DNS configuration. Who already have a branch published will skip the step 2.
Add / point the following IP addresses to your custom domain in DNS zone with A
record
- 185.199.108.153
- 185.199.109.153
- 185.199.110.153
- 185.199.111.153
Come back to your repository Settings-> Github Pages, then put your domain name to this field and click on Save
After the step 4, your github page will be published with your custom domain name. When you'll visit github project link like https://tradecoder.github.io/github-custom-domain-config and when you'll visit your custom domain like https://tradecoder.com, for both the cases it will load with your custom domain name. It may take few minutes to get effective.
And if you find in the section of Github Pages that https is not active, it may take upto 24 hours to be active. If not, you may have to remove and add the domain in the github page again.