Create static website with custom domain names. Perks is having your own web hosting at minimal cost. The only cost is the cost of the custom domain name.
Requirements:
- Github account: For hosting the static website.
- Custom domain name: Purchase domain names from GoDaddy or Namecheap etc. Alternatively, can use GitHub default url <username>.github.io
Steps:
- Github
- Create new repository with following format <username>.github.io where username refers to GitHub userid.
- In the repository, go to setting: Under Theme, choose a Jekyll theme. When finish, click on Source, select master branch. A file needs to exist in repository before Source option can be selected.
- If you have purchase your custom domain, you need to configure the A records and CNAME for the domain at the registrar to point to the GitHub site. Proceed to make the necessary changes at the domain registrar website.
- Registrar (Below is using GoDaddy as example)
- Under My Products, select the domain name that will be used. Click on Manage button.
- Once in setting page, scroll down to Additional Settings and click Manage DNS
- Within the DNS management page, Add in 4 “A” row with each pointing to IP as follows:
- 185.199.108.153
- 185.199.109.153
- 185.199.110.153
- 185.199.111.153
- Add in the CNAME pointing to your repository at Github: <username>.github.io
- View link for more info on configuring domain name with goDaddy
- Similarly, see following link for Namecheap
- Note: if you setup using A records and CNAME, leave the nameservers as default.
- Once the settings are configured, return to GitHub pages to add the custom domain name
- Github
- At the setting page, add the custom domain name in the Custom Domain section.
- Tick Enforce Https (may take up to 24 hours to take effect)
- Completed.
- Proceed to add in contents in GitHub using markdown.
Resources
- https://guides.github.com/features/pages/
- https://medium.com/roomjs/create-and-host-a-static-website-on-github-pages-with-a-custom-domain-8dcfbce1d15d
Notes
- GoDaddy default A records: 50.63.202.32