First part of the tutorial series on creating a blog with GatsbyJS on Stay Regular.
Clone from repo:
git clone https://github.com/whoisryosuke/gatsby-blog-tutorial.git gatsby-example-site
Make sure that you have the Gatsby CLI program installed:
npm install --global gatsby-cli
Then you can run it by:
cd gatsby-example-site
npm run develop
- Create a git repo inside your project.
- Add your Github hosted repository as a remote repository named origin:
git remote add origin http://github.com/username/repo-name.git
- Change the pathPrefix in
gatsby-config.js
to your Github repository's name. - Commit any changes with git to the master branch. Then run:
npm run deploy
- Click the following button, connect your Github account, and create a new repo.
- Go to the Deploys section, then click the Deploy settings button.
- Under Continuous Deployment, the first box should be Deploy Settings. Click Edit Settings at the bottom of the container.
- Change your Build command to
npm run build
- Change your Publish directory to
public
- Make sure the branch is master, or your preferred production branch.
- Click Save.
- Go to the Deploys section again and click Trigger deploy. Make sure the clear cache is checked, and run the deploy.