Skip to content

Commit 2e6661f

Browse files
committed
ops(deploy): 添加Cloudflare Pages部署配置
1 parent 170a107 commit 2e6661f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ jobs:
2121
node-version: 20
2222
cache: 'npm'
2323

24+
- name: Install Wrangler
25+
run: npm install -g wrangler
26+
27+
- name: Create Cloudflare Pages project
28+
run: |
29+
npx wrangler pages project create wuxia-game --production-branch=main --yes || true
30+
env:
31+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
32+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
33+
2434
- name: Install dependencies
2535
run: npm ci
2636

@@ -34,5 +44,3 @@ jobs:
3444
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3545
projectName: wuxia-game
3646
directory: dist
37-
# 可选:如果要同时部署 API 函数,使用下面的配置
38-
# 需确保 wrangler.toml 中正确配置了 pages_build

0 commit comments

Comments
 (0)