-
Notifications
You must be signed in to change notification settings - Fork 400
108 lines (94 loc) · 3.84 KB
/
deploy-examples.yml
File metadata and controls
108 lines (94 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# 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@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
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 }}