Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/shopify_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy to Shopify

on:
workflow_call:
inputs:
working-directory:
description: 'Working directory for the app'
required: false
type: string
default: '.'
deploy-production:
description: "Boolean to check if deploy to production"
type: boolean
default: false
development-toml-name:
description: 'Name of development.toml'
required: false
type: string
default: 'shopify.app.development.toml'
production-toml-name:
description: 'Name of .toml'
required: false
type: string
default: 'shopify.app.toml'

secrets:
shopify_cli_token:
description: 'Shopify CLI authentication token'
required: true

jobs:
deploy:
name: Deploy to Shopify
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: ${{ inputs.working-directory }}/yarn.lock

- name: Install dependencies
working-directory: ${{ inputs.working-directory }}
run: yarn install --frozen-lockfile

- name: Download build artifacts
uses: actions/download-artifact@v6
with:
name: build-artifacts
path: ${{ inputs.working-directory }}

- name: Configure Shopify CLI
working-directory: ${{ inputs.working-directory }}
run: |
if [ "${{ inputs.deploy-production }}" = "true" ]; then
yarn shopify app config use ${{ inputs.production-toml-name }}
else
yarn shopify app config use ${{ inputs.development-toml-name }}
fi

- name: Deploy to Shopify
working-directory: ${{ inputs.working-directory }}
run: yarn shopify app deploy --force
env:
SHOPIFY_CLI_TOKEN: ${{ secrets.shopify_cli_token }}
SHOPIFY_FLAG_PATH: ${{ inputs.working-directory }}