Skip to content

Commit a8e980f

Browse files
committed
chore: update workflows
1 parent b162c47 commit a8e980f

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

.github/workflows/cloudflare-preview-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
env:
3333
CF_WORKERS: 1
3434

35-
- name: Upload deployment package
35+
- name: Upload build artifact
3636
uses: actions/upload-artifact@v4
3737
with:
3838
name: cloudflare-dist
39-
path: apps/web/dist/**
39+
path: apps/web/dist
4040
retention-days: 5
4141

4242
- name: Save PR number

.github/workflows/cloudflare-preview-deploy.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ jobs:
2222
pull-requests: write
2323

2424
steps:
25-
- name: Download build artifact
26-
uses: actions/download-artifact@v4
27-
with:
28-
name: cloudflare-dist
29-
path: apps/web/dist
30-
github-token: ${{ secrets.GITHUB_TOKEN }}
31-
repository: ${{ github.repository }}
32-
run-id: ${{ github.event.workflow_run.id }}
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
3327

3428
- name: Download PR number
3529
uses: actions/download-artifact@v4
@@ -44,17 +38,28 @@ jobs:
4438
id: read-pr
4539
run: echo "pr_number=$(cat pr-id.txt)" >> $GITHUB_OUTPUT
4640

41+
- name: Download build artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: cloudflare-dist
45+
path: apps/web/dist
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
repository: ${{ github.repository }}
48+
run-id: ${{ github.event.workflow_run.id }}
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v6
52+
with:
53+
node-version: 22
54+
4755
- name: Deploy to Cloudflare Workers
4856
id: deploy
4957
uses: cloudflare/wrangler-action@v3
5058
with:
5159
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
5260
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
53-
command: deploy --name md-pr-${{ steps.read-pr.outputs.pr_number }}
61+
command: deploy --name md-pr-${{ steps.read-pr.outputs.pr_number }} --assets dist
5462
workingDirectory: apps/web
55-
env:
56-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
57-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5863

5964
- name: Get deployment URL
6065
id: deployment-url

0 commit comments

Comments
 (0)