Chad Adams • Jun 23, 2019 • 1 min read
This is how I setup my blog blog.chadalen.com.
First, create a Gatsby project. (I'm assuming if you're reading this you know what Gatsby is.)
Gatsby has good documentation on how to do this. (See here)
On your DNS provider create 4 A records and 1 CNAME record (Github Docs)
Next, we need to create a file in the root of the project named "CNAME". Inside that, put the url of your custom domain. In my case I put "blog.chadalen.com"
Lastly, go into your repository settings on GitHub. Look where it says "GitHub Pages", under there enter your custom domain. If you're not able to select "Enforce HTTPS" you might need to wait a few minutes, if you still can't select it make sure your domain has the 4 A records.
That's it! Now you can create a free website with React and Gatsby hosted on GitHub Pages!