You can host static websites freely on GitHub Pages. They are awesome!
- GitHub: create Project Pages manually
- GitHub: Adding a CNAME file to your repository
- GitHub: Tips for configuring an A record with your DNS provider
1. Clone repo
2. Create gh-pages branch
git checkout --orphan gh-pages
3. Remove the previous stuff
might not need to if it's a new repo
git rm -rf .
git push --set-upstream origin gh-pages git push origin gh-pages
5. Custom domain example.com
5.1 CNAME file in repo
in the repo, gh-pages branch, create a file named "CNAME" with a simgle line of your custom domain name "example.com"
5.2 DNS settings at your DNS provider
For apex domain example.com, create A records:
@ 188.8.131.52 @ 184.108.40.206
For subdomain abc.example.com, simply create a cname file pointing to username.github.io