Deployment
Shopify CLI
Build and deploy a new
theme to the store that you're connected to.
npm run deploy:new
yarn deploy:new
Build and deploy to an existing
theme on the store that you're connected to.
npm run deploy
yarn deploy
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
Make sure you have a clean git history and committed all files.
Run the
shopify:pull
command.
npm run shopify:pull
yarn shopify:pull
- 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.
- When you're ready to publish a theme simply run the build task.
npm run webpack:build
yarn webpack:build
- Then move the contents of the
shopify
directory from thesource-code
to thedist-code
directory and push your changes to GitHub.
shopify-theme-lab/
├─ source-code/shopify/ <- move all contents from here
└─ dist-code/ <- to here
2
3
- 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.