Skip to content

Commit

Permalink
ci: 改用 wrangler-action@v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Nov 23, 2024
1 parent f486b63 commit 1eb9175
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@ jobs:
- name: 构建项目
run: pnpm run build # 构建 VitePress 项目

# 第五步:安装 Wrangler
- name: 安装 Wrangler
run: pnpm add -g wrangler@3 # 安装 Wrangler v3

# 第六步:发布到 Cloudflare Pages
- name: 发布到 Cloudflare Pages
uses: cloudflare/pages-action@v1
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} # Cloudflare Pages API Token
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }} # Cloudflare 账户 ID
projectName: blog # Cloudflare Pages 项目名称
directory: docs/.vitepress/dist # 构建输出目录
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
command: pages deploy docs/.vitepress/dist --project-name=blog

- name: 测试打印URL
run: echo ${{ steps.deploy.outputs.url }}

# # 第六步:发布到 Cloudflare Pages
# - name: 发布到 Cloudflare Pages
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} # Cloudflare Pages API Token
# accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }} # Cloudflare 账户 ID
# projectName: blog # Cloudflare Pages 项目名称
# directory: docs/.vitepress/dist # 构建输出目录

0 comments on commit 1eb9175

Please sign in to comment.