A opinionated set of GitHub Actions to automatically create/push/preview themes on Shopify stores.
These actions are built on top of Theme Kit, and expects a config.yml
file to exist in your repository.
This action will deploy one or more themes using Theme Kit's deploy
command.
---
- name: Deploy theme
uses: grafikr/shopify-actions@v1
with:
ACTION: 'DEPLOY'
COMMAND: "--env='*-production' --allow-live"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This action will create a theme, and add a comment with preview links.
This command will also download any ignored file from the environment specified in the THEME_KIT_ENVIRONMENT
input.
---
- name: Create preview
uses: grafikr/shopify-actions@v1
with:
ACTION: 'PREVIEW'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This action will delete a theme which has been created for preview. This is usually an action you want to use when closing a pull request.
---
- name: Create preview
uses: grafikr/shopify-actions@v1
with:
ACTION: 'DELETE'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Input | Description | Required | Default |
---|---|---|---|
ACTION | The action you want to run. | ✅ | - |
THEME_KIT_ENVIRONMENT | The "environment" in your config.yml the action should get it values from. It will use this to get the token and URL to create/delete a preview theme. |
❌ | development |
THEME_KIT_DEPLOY_COMMAND | The Theme Kit command you want to use to deploy themes. E.g. '--env="*-production" --allow-live'. |
❌ | - |
SHOPIFY_THEME_ROLE | The "role" the preview theme will get. Read more about roles |
❌ | development |
GITHUB_TOKEN | The Github token. Used to create comments. | ✅ | - |
BUILD_DIR | The directory where the project will be build. Should only be changed if you already use this directory. | ❌ | build |