From fe26b2c26cd3170a304cf85e1eb7ad08d8e4f9c0 Mon Sep 17 00:00:00 2001 From: Lee Date: Sat, 23 Nov 2024 12:20:17 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=94=B9=E7=94=A8=20wrangler-action@v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cf.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cf.yml b/.github/workflows/cf.yml index d367bb0..d207b10 100644 --- a/.github/workflows/cf.yml +++ b/.github/workflows/cf.yml @@ -37,15 +37,21 @@ 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 + 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 # 构建输出目录