Skip to content

Commit a33af79

Browse files
committed
fix: install wrangler in CI and use pnpm exec instead of npx
npx can't find wrangler in pnpm workspace — wrangler isn't in apps/web/package.json deps. Install it as a workspace dev dep in CI and use pnpm exec for the deploy step.
1 parent 35aceb1 commit a33af79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
- name: Install dependencies
2222
run: pnpm install --frozen-lockfile
2323

24+
- name: Install wrangler
25+
run: pnpm add -Dw wrangler
26+
2427
- name: Build (dev)
2528
if: github.ref == 'refs/heads/dev'
2629
run: pnpm --filter @codingcatdev/web build
@@ -37,15 +40,15 @@ jobs:
3740

3841
- name: Deploy to dev
3942
if: github.ref == 'refs/heads/dev'
40-
run: npx wrangler deploy
43+
run: pnpm exec wrangler deploy
4144
working-directory: apps/web
4245
env:
4346
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4447
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4548

4649
- name: Deploy to production
4750
if: github.ref == 'refs/heads/main'
48-
run: npx wrangler deploy --env production
51+
run: pnpm exec wrangler deploy --env production
4952
working-directory: apps/web
5053
env:
5154
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

0 commit comments

Comments
 (0)