test(e2e): add metaobjects recipe e2e tests (#3548) #5102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Don't change the line below! | |
| #! oxygen_storefront_id: 1000014888 | |
| name: Deploy Recipe Examples | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'templates/skeleton/**' | |
| - 'cookbook/recipes/**' | |
| - '.github/workflows/deploy-examples.yml' | |
| workflow_dispatch: # Allow manual runs | |
| permissions: | |
| contents: read | |
| deployments: write | |
| jobs: | |
| deploy: | |
| name: Deploy Recipe to Oxygen | |
| # TEMPORARILY DISABLED: Recipe system is being re-evaluated. | |
| # Remove this line to re-enable. | |
| if: false | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| recipes: [ | |
| {name: 'metaobjects', token: '1000014928'}, | |
| {name: 'third-party-api', token: '1000014929'}, # Replaces third-party-queries-caching | |
| {name: 'custom-cart-method', token: '1000014930'}, | |
| {name: 'legacy-customer-account-flow', token: '1000022490'}, | |
| ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: 📦 Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 | |
| with: | |
| run_install: false | |
| - name: ⎔ Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - name: Cache node modules | |
| id: cache-pnpm | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: 📥 Install dependencies (root) | |
| run: pnpm install --frozen-lockfile | |
| - name: 📦 Build packages | |
| run: | | |
| CI=true pnpm run build:pkg | |
| - name: 📥 Install dependencies (cookbook) | |
| working-directory: cookbook | |
| run: pnpm install --frozen-lockfile | |
| - name: 🍳 Apply recipe to skeleton | |
| working-directory: cookbook | |
| run: | | |
| echo "Applying recipe: ${{ matrix.recipes.name }}" | |
| pnpm run cookbook -- apply --recipe ${{ matrix.recipes.name }} | |
| - name: 📥 Install dependencies (skeleton with recipe) | |
| working-directory: templates/skeleton | |
| run: | | |
| # Install in the monorepo context to use workspace packages | |
| pnpm install --frozen-lockfile | |
| - name: 📝 Generate GraphQL types | |
| working-directory: templates/skeleton | |
| run: | | |
| pnpm run codegen | |
| - name: 🔨 Build skeleton with recipe | |
| working-directory: templates/skeleton | |
| run: | | |
| SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false pnpm run build | |
| - name: 🚀 Deploy to Oxygen | |
| id: deploy | |
| working-directory: templates/skeleton | |
| run: | | |
| pnpm exec shopify hydrogen deploy --force --no-lockfile-check --token=$OXYGEN_DEPLOYMENT_TOKEN_${{ matrix.recipes.token }} | |
| env: | |
| SHOPIFY_HYDROGEN_FLAG_METADATA_DESCRIPTION: 'Recipe: ${{ matrix.recipes.name }} - ${{ github.event.head_commit.message }}' | |
| OXYGEN_DEPLOYMENT_TOKEN_1000014888: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000014888 }} | |
| OXYGEN_DEPLOYMENT_TOKEN_1000022490: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000022490 }} | |
| OXYGEN_DEPLOYMENT_TOKEN_1000014892: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000014892 }} | |
| OXYGEN_DEPLOYMENT_TOKEN_1000014928: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000014928 }} | |
| OXYGEN_DEPLOYMENT_TOKEN_1000014929: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000014929 }} | |
| OXYGEN_DEPLOYMENT_TOKEN_1000014930: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000014930 }} |