Adding domain for your github project
20 Sep 2016I have a problem. Each time I want add domain to my custom github project I forget what I should do exactly. That’s why I want to post this SO answer in my blog. I hope it would helpful not only for me.
To Setup a custom domain for your gh-pages project repo that handles
www.yourdomain.com and yourdomain.com (assumes you already have a gh-pages
branch on your repo) you need this:
- From your project repo,
gh-pagesbranch. Create aCNAMEfile with the contentsyourdomain.com. - In your DNS manager, setup two
CNAMErecords. One for the root apex (@) and one forwww. Both point toYOURusername.github.io. If your DNS provider does NOT supportALIASrecords on the root apex (@), simply createArecords that point to192.30.252.153and192.30.252.154.
After that wait til your name servers update:
dig yourdomain.com +nostats +nocomments +nocmd
Original link: stackoverflow.com/a/9123911