From 876ff73207d6822c833fc50e441e09ad43e2dd04 Mon Sep 17 00:00:00 2001 From: Kai Nguyen Date: Fri, 10 Apr 2026 17:03:04 +1000 Subject: [PATCH 1/2] MI-315: Simplified Shopify deployment workflow and update document --- .github/workflows/shopify-deploy.yml | 40 ++++------------------------ docs/shopify-deploy.md | 31 +++------------------ 2 files changed, 9 insertions(+), 62 deletions(-) diff --git a/.github/workflows/shopify-deploy.yml b/.github/workflows/shopify-deploy.yml index 2247156..b194c70 100644 --- a/.github/workflows/shopify-deploy.yml +++ b/.github/workflows/shopify-deploy.yml @@ -8,26 +8,10 @@ on: required: false type: string default: '.' - 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 + shopify-toml-name: + description: 'Name of Shopify TOML file' + required: true type: string - default: 'shopify.app.toml' - - # Deployment Control - deploy-staging: - description: "Boolean to check if deploy to staging" - type: boolean - default: false - deploy-production: - description: "Boolean to check if deploy to production" - type: boolean - default: false secrets: shopify_cli_token: @@ -39,13 +23,6 @@ jobs: name: Deploy to Shopify runs-on: ubuntu-latest steps: - - name: Check deployment selection - if: ${{ inputs.deploy-staging == false && inputs.deploy-production == false }} - run: | - echo "Error: Neither 'deploy-staging' nor 'deploy-production' is selected." - echo "Please select at least one deployment target." - exit 1 - - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 with: @@ -69,16 +46,9 @@ jobs: - 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 + run: yarn shopify app config use ${SHOPIFY_TOML_NAME} env: - INPUTS_PRODUCTION_TOML_NAME: ${{ inputs.production-toml-name }} - INPUTS_DEVELOPMENT_TOML_NAME: ${{ inputs.development-toml-name }} - INPUTS_DEPLOY_PRODUCTION: ${{ inputs.deploy-production }} + SHOPIFY_TOML_NAME: ${{ inputs.shopify-toml-name }} - name: Deploy to Shopify working-directory: ${{ inputs.working-directory }} diff --git a/docs/shopify-deploy.md b/docs/shopify-deploy.md index 6366c5b..5ee3d3c 100644 --- a/docs/shopify-deploy.md +++ b/docs/shopify-deploy.md @@ -1,24 +1,16 @@ # Shopify App Deployment -A reusable workflow for deploying Shopify apps using the Shopify CLI with support for staging and production environments. +A reusable workflow for deploying Shopify apps using the Shopify CLI. #### **Features** -- **Multi-environment support**: Deploy to staging or production using different TOML configuration files - **Configurable working directory**: Support for monorepo structures with custom app locations -- **Build artifact integration**: Downloads pre-built artifacts before deployment - **Shopify CLI integration**: Uses Shopify CLI for configuration and deployment -- **Deployment validation**: Ensures at least one deployment target is selected #### **Inputs** | Name | Required | Type | Default | Description | |------|----------|------|---------|-------------| -| **Core Configuration** | | working-directory | ❌ | string | . | Working directory for the app | -| development-toml-name | ❌ | string | shopify.app.development.toml | Name of development TOML config file | -| production-toml-name | ❌ | string | shopify.app.toml | Name of production TOML config file | -| **Deployment Control** | -| deploy-staging | ❌ | boolean | false | Enable staging deployment | -| deploy-production | ❌ | boolean | false | Enable production deployment | +| shopify-toml-name | ✅ | string | | Name of Shopify TOML configuration file | #### **Secrets** | Name | Required | Description | @@ -46,7 +38,7 @@ jobs: uses: aligent/workflows/.github/workflows/shopify-deploy.yml@main with: working-directory: apps/shopify-app - deploy-staging: true + shopify-toml-name: shopify.app.development.toml secrets: shopify_cli_token: ${{ secrets.SHOPIFY_CLI_TOKEN }} ``` @@ -60,26 +52,11 @@ on: ... jobs: - build: deploy-production: uses: aligent/workflows/.github/workflows/shopify-deploy.yml@main with: working-directory: apps/shopify-app - deploy-production: true - secrets: - shopify_cli_token: ${{ secrets.SHOPIFY_CLI_TOKEN }} -``` - -**Custom TOML Configuration:** -```yaml -jobs: - deploy: - uses: aligent/workflows/.github/workflows/shopify-deploy.yml@main - with: - working-directory: apps/shopify-app - development-toml-name: shopify.app.dev.toml - production-toml-name: shopify.app.prod.toml - deploy-staging: true + shopify-toml-name: shopify.app.toml secrets: shopify_cli_token: ${{ secrets.SHOPIFY_CLI_TOKEN }} ``` From 4b092f707de41a510c3a90863eb0d2324d24bb11 Mon Sep 17 00:00:00 2001 From: Kai Nguyen Date: Fri, 10 Apr 2026 17:09:46 +1000 Subject: [PATCH 2/2] MI-315: Small update to document --- docs/shopify-deploy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shopify-deploy.md b/docs/shopify-deploy.md index 5ee3d3c..96d3b0d 100644 --- a/docs/shopify-deploy.md +++ b/docs/shopify-deploy.md @@ -38,7 +38,7 @@ jobs: uses: aligent/workflows/.github/workflows/shopify-deploy.yml@main with: working-directory: apps/shopify-app - shopify-toml-name: shopify.app.development.toml + shopify-toml-name: shopify.app.staging.toml secrets: shopify_cli_token: ${{ secrets.SHOPIFY_CLI_TOKEN }} ```