@jawannc/shopify-deploybot
v3.0.3
Published
Something Digital Shopify Deployment Tool ππ
Readme
Shopify Deploybot
This is a node module to assist with PR preview deployments to Shopify stores. It's meant to be used with the Something Digital Azure DevOps Pipelines.
Important: Scope and Limitations
This tool is specifically designed for: β PR Preview Deployments
- Creating isolated, unpublished preview themes
- Enabling PR review with full theme previews
- Automatic cleanup of old preview themes
- CI/CD integration for pull requests
β NOT for Production Deployments This tool should NOT be used for production theme deployments, which require:
- Manual syncing of live theme changes
- Careful preservation of merchant customizations
- Verification of app embed settings
- Coordinated QA and stakeholder approval
- Proper backup and rollback procedures
For production deployments, follow the manual deployment process documented in your team's deployment guidelines.
By default, the deployed theme contains the deployment date and commit hash. However, because the theme title can be changed by the merchant, the deployment tooling injects a new file called deploybot-meta.json within the /assets. This file contains the date of deployment and the commit hash which was used during that deployment. This allows our tooling to know what version is deployed even after a theme name is changed in the admin. The file is accessible via Shopify theme code editor and also via the customer storefront for automated performance tooling.
Example:
{
"commitHash": "d90cad85f0b786e405c3f6c53d8777b21bdc77fb",
"deployDate": "Wed Jun 03 2020 17:54:27 GMT+0000 (Coordinated Universal Time)"
}
Install
To install, run npm i -g @somethingdigital/somethingdigital-shopify-deploybot@{version}, where {version} is the
specific version needed (can be excluded for latest version).
To run a command, run deploybot <command>.
Publish new version
To publish a new version on npm, run npm publish.
Commands
Command | Purpose
-|-
commitHash | Retrieves latest commit hash of live theme
download | Download the live theme. Used during nightly theme sync
prep | Download live theme settings
upload | Upload theme.zip to shop
check | Check if theme is processing.
publish | Publish theme
cleanup | Delete theme if PR or keep up to 5 releases for main/develop deploy.
Parameters coming soon.
Burt's Bees Baby Integration
This version of DeployBot has been customized for the Burt's Bees Baby Shopify theme:
Key Features
- Uses Node.js 20.x for compatibility with latest Shopify CLI
- Uses Vite for asset building (controlled by ENABLE_ASSETS_BUILD)
- Uses Shopify CLI commands instead of API for better reliability
- Manual theme publishing only (no automatic publishing)
- Improved linting paths for Burt's Bees theme structure
Required Environment Variables
SHOPIFY_FLAG_STORE- Your Shopify store URLSHOPIFY_CLI_THEME_TOKEN- Theme access token from Shopify adminENABLE_ASSETS_BUILD- Set to 'true' to build assets with Vite
Pipeline Flow
- Build: Compiles theme assets using Vite if ENABLE_ASSETS_BUILD is true
- Download: Gets settings from live theme to apply to preview
- Upload: Creates preview theme in Shopify admin (unpublished)
- Check: Verifies theme is previewable and generates preview URL
- Cleanup: Removes old preview themes (keeps 5 most recent)
Preview vs Production
This tool creates isolated preview themes that:
- Are always unpublished (never affect live site)
- Include all theme files (templates, sections, etc.)
- Copy settings from live theme for accurate previews
- Are automatically cleaned up
For production deployments, use the manual process which includes:
- Pull latest from live theme (
shopify theme pull) - Carefully review and merge changes:
- Keep merchant/CMS changes from live theme
- Keep feature code from PRs
- Preserve third-party vendor code
- Create release theme (
shopify theme share) - Get QA and client approval
- Manually publish at scheduled time
- Verify app embeds and settings
Preview Themes
- Created as unpublished themes in Shopify admin
- Named with PR number and branch (e.g., "PR #123 - feature/my-branch")
- Accessible via preview URL or Shopify admin
- Automatically cleaned up to maintain theme limit
Development
- Run
npm installto install dependencies. - Copy .env.sample to .env and add appropriate credentials
- Run
npm linkto symlink cli bin tool. - Run
npx deploybot <command>to run a command - Once you're finished developing, run
npm unlink
