Have you ever heard of GitHub Pages? Yes, no? Well, GitHub Pages let you host your static website files on their servers for free. All you have to do is to create a git repo, push your files and point your domain to it. But how do you do that? Sounds all quite easy, but there are a few steps to follow in order to make you happy at the end.
- Buy your personal domain at one of the domain registrars out there
- Create a free account at cloudflare
- Add your domain to it
- Go back to the registrar and add the cloudflare nameservers to your domain
- Set two A records in the DNS settings to the GitHub Pages servers (22.214.171.124 / 126.96.36.199)
- Create a CNAME record with the name www in the DNS settings which points to your GitHub Pages repo (eg. yourreponame.github.io)
- To use SSL for your site, go to the Crypto menu and set the SSL to Full
- Create a GitHub Pages repo and add your domain name as custom domain (Settings —> GitHub Pages -> Custom domain)
- Push your website code (files) to you repo
If you need a step be step guide for setting up things, here is a good one.