Deployment

Shopify CLI

Build and deploy a new theme to the store that you're connected to.

npm run deploy:new
1
yarn deploy:new
1

Build and deploy to an existing theme on the store that you're connected to.

npm run deploy
1
yarn deploy
1

Pull

TIP

The deploy task overrides all files of the remote theme! If any changes were made through the Shopify theme editor you might want to download the theme files before deploying

  1. Make sure you have a clean git history and committed all files.

  2. Run the shopify:pull command.

npm run shopify:pull
1
yarn shopify:pull
1
  1. Revert any files that were pulled and you don't need e.g. Because you already have a newer version.

GitHub integration

Shopify provides a Shopify GitHub integrationopen in new window, but since Theme Lab uses a custom build-workflow it's not out of the box compatible with the integration.

TIP

You can only connect branches that match the default Shopify theme folder structure via the Shopify GitHub integration.

Repo

One of the simplest ways to circumvent this limitation is to use a separate repo for your dist files.

  1. When you're ready to publish a theme simply run the build task.
npm run webpack:build
1
yarn webpack:build
1
  1. Then move the contents of the shopify directory from the source-code to the dist-code directory and push your changes to GitHub.
shopify-theme-lab/
├─ source-code/shopify/  <- move all contents from here
└─ dist-code/            <- to here
1
2
3
  1. Follow the Shopify GitHub integration Instructionsopen in new window and select your main brach from the dist repo for the Shopify GitHub integration.

Other

The Shopify docsopen in new window describe several other ways how to set up version control with a custom build-workflow.