Skip to content

Commit 2086457

Browse files
committed
fix: install worker dependencies before deployment
- Add Node.js setup step - Install npm dependencies in worker directory - Use npx to run local wrangler instead of global This ensures all required dependencies are available for the worker deployment. Signed-off-by: Mark Phelps <[email protected]>
1 parent 029339c commit 2086457

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/worker.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,22 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22-
- name: Install Wrangler
23-
run: npm install -g wrangler
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
27+
- name: Install dependencies
28+
working-directory: ./worker
29+
run: npm install
2430

2531
# Deploy preview
2632
- name: Deploy Worker Preview
2733
id: deploy
2834
working-directory: ./worker
2935
run: |
3036
# Deploy the worker to preview environment
31-
OUTPUT=$(wrangler deploy --config wrangler.jsonc --env preview 2>&1)
37+
OUTPUT=$(npx wrangler deploy --config wrangler.jsonc --env preview 2>&1)
3238
echo "$OUTPUT"
3339
3440
# Extract the deployed URL from the output

0 commit comments

Comments
 (0)