Skip to content

Deploy and Publish

Arpit Sheth edited this page Jul 31, 2020 · 4 revisions

This repo is configured to allow us to deploy the demo site to GitHub pages and publish the theme to NPM. It's good practice to do this anytime we're ready to release a updates to the Polaroid theme.

You can learn more about how I set it up from this Gatsby Theme development guide I wrote.

Prepare for Release

  1. Verify that your changes are working on a production build of your demo site
yarn workspace demo build
yarn workspace demo serve
  1. If everything is working, update the theme's version in the /theme/package.json file. This repo uses semantic versioning.
  2. Commit your latest changes (to the master branch)

Deploy Demo Site to GitHub Pages

Typically, the deploy script will deploy whatever is on the master branch for the demo site.

  1. Change directory to the demo site
cd demo
  1. Run the deploy command
yarn deploy

⚠️ Note: You should avoid combining steps #1 and #2 by doing yarn workspace demo deploy, because there is currently a bug where Gatsbly does not correctly prefix the paths.

  1. Review the changes on GitHub pages (https://shetharp.github.io/gatsby-theme-polaroid/)

Publish Theme as a Package to NPM

  1. Verify that you are logged into npm by running
npm whoami
  1. Change directories into your theme workspace
cd theme
  1. Publish to npm!
npm publish --access-public