Create Github Account
Create New Repository in your Github account
After the initial setup of your repo and uploading your code create a branch called “gh-pages”. This step is key because the branch name MUST be gh-pages for Github to recognize it as a public facing website.
git init git add . git commit -m "first commit" git branch gh-pages git checkout gh-pages git push origin gh-pages
Add a CNAME file with your domain name, make sure this is added on your gh-pages branch
git checkout gh-pages touch CNAME --- add domain to CNAME file ie. damngoodbrew.co --- git add . git commit -m "first commit" git push origin gh-pages
Go to Namecheap (or whatever domain registrar you use) and click Manage DNS and put the new fields in below:
A Record - @ - 220.127.116.11 A Record - @ - 18.104.22.168 CNAME - wwww - YOURGITHUBUSERNAME.github.io
WAIT.. a few hours or a full day, sometimes it takes quite a while for the domain changes to take effect so don’t fret.
Github Pages provides a quick and easy solutions to host static websites for free which I personally leverage all the time for simple landing pages!
Check out the video below for a more in-depth overview for the Zero to Startup in 30 Days Challenge.
Written by Tim Moreton who lives and works
in Philadelphia building useful things.