A set of GitHub Actions to enable fast Shopify theme development/review workflows, options:
After any deployment, if GITHUB_TOKEN
is set & the deployment was triggered by a PR, a comment will be added to the PR with a link to view the Shopify theme preview (as above).
Themes: Read and write
.SHOPIFY_PASSWORD
, SHOPIFY_API_KEY
and SHOPIFY_STORE_URL
(i.e. mystore.myshopify.com
).github
folder with a workflows
folder inside./github/workflows/
folder add any of the below theme development/review workflows; When a:PR is opened/updated create and deploy a PR specific Shopify theme
PR is closed remove the previously created PR specific Shopify theme
PR is opened/updated deploy to a specified theme i.e. testing/staging theme
Requires a Shopify Private App to be created with the permissions: Themes: Read and write
Github action inputs:
ACTION
required
DEPLOYMENT_PREVIEW
Creates a new Shopify theme for each PR raised. If a PR specific theme already exists it will be updated (i.e. on a git push
after the PR was created).
REMOVE_DEPLOYMENT_PREVIEW_THEME
Removes a previously created PR specific Shopify theme that was created when ACTION
was set to DEPLOYMENT_PREVIEW
DEPLOY
Deploys to the specified Shopify theme, useful for defined testing
/staging
/production
themes. SHOPIFY_THEME_ID
must be set.
_If deploying to the live Shopify stores theme make sure to set SHOPIFY_ALLOW_LIVE_THEME_DEPLOYMENT
to true
_
SHOPIFY_STORE_URL
required
The shopify development store i.e. my-store.myshopify.com
Should be stored as a GitHub secret!
SHOPIFY_PASSWORD
required
The Shopify store's private app password used with themekit
Should be stored as a GitHub secret!
SHOPIFY_API_KEY
required
The Shopify store's private app API Key to allow theme creation and removal
Should be stored as a GitHub secret!
SHOPIFY_THEME_DIRECTORY
required
The directory containing the Shopify theme to deploy i.e. ./dist
SHOPIFY_THEME_ID
optional
The Shopify theme that will be deployed to (only used if 'ACTION' is 'DEPLOY')
SHOPIFY_ALLOW_LIVE_THEME_DEPLOYMENT
optional
If deploying to a 'live' (published) Shopify theme this must be set to true
IGNORED_FILES
optional
Ignore files pattern. Comma seperated string of patterns / file paths.
GITHUB_TOKEN
optional
Github authentication token that allows comments to be created on PRs.
If not set comments cannot be created on PRs and previously created PR specific Shopify themes cannot be removed.
Github action outputs (can be used in following steps):
SHOPIFY_THEME_ID
The newly created/found/supplied Shopify theme id
SHOPIFY_THEME_PREVIEW_URL
The URL the theme can be previewed at
Shopify Theme Actions is MIT licensed.