diff --git a/.github/workflows/shopify-deploy.yml b/.github/workflows/shopify-deploy.yml index 1b9c822..8be5cb4 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 # Backport Configuration create-backport-pr: @@ -49,13 +33,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: @@ -79,16 +56,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 855f20d..ed17b2c 100644 --- a/docs/shopify-deploy.md +++ b/docs/shopify-deploy.md @@ -1,11 +1,9 @@ # 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 - **Automatic backporting**: Optional PR creation to backport changes to staging branch @@ -13,13 +11,8 @@ A reusable workflow for deploying Shopify apps using the Shopify CLI with suppor #### **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 | | **Backport Configuration** | | create-backport-pr | ❌ | boolean | false | Create a backport PR after deployment | | backport-target-branch | ❌ | string | staging | Target branch for backport PR | @@ -52,7 +45,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.staging.toml secrets: shopify_cli_token: ${{ secrets.SHOPIFY_CLI_TOKEN }} ``` @@ -66,26 +59,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 }} ```