I've built a few sites now using Gatsby.js, the fantastic static site generator tool based on React. When I first started out I hosted my sites on Github pages, which sometimes became tedious, I think i lost hours trying to make sure the
pathPrefix was correct.
I eventually came across Netlify, a cloud based hosting provider and much more.
What i found remarkable was their free tier hosting which provides everything I needed.
So this guide is a top level look at hosting a personal portfolio site on Github/Netlify.
First things first, make sure you have your Gatsby.js project on Github.
I've chosen Github here.
Select which repository you would like Netlify to host, I've created a Gatsby demo here called
davids-gatsby-site from the Gatsby starter kit.
Now Netlify should automatically detect our site is Gatsby.js and pre-populate the Basic built settings.
Pro tip: If we wanted to we can create a
netlify.toml file, we won't dive into this today but one of the advantages of this are we can keep this in code.
Deployment will run in the background, then after a few mins it should be done.
There you have it, here you've deployed the site Gatsby.js site to Netlify.