Skip to content

Commit 2da1f9d

Browse files
committed
ci: deploy to Cloudflare Pages via GitHub Actions + wrangler
Build in GH Actions (reliable env), upload dist with wrangler-action. Avoids CF dashboard build env. Needs repo secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.
1 parent 62d0e50 commit 2da1f9d

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
deployments: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: pnpm/action-setup@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: pnpm
23+
24+
- run: pnpm install --frozen-lockfile
25+
26+
- run: pnpm build
27+
28+
- name: Deploy to Cloudflare Pages
29+
uses: cloudflare/wrangler-action@v3
30+
with:
31+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
32+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
33+
command: pages deploy dist --project-name=dentime --branch=${{ github.head_ref || github.ref_name }}

0 commit comments

Comments
 (0)