[GH-ISSUE #758] [BUG] Github Action 部署 worker 失败 #284

Closed
opened 2026-02-26 20:36:28 +03:00 by kerem · 7 comments
Owner

Originally created by @catfishlty on GitHub (Nov 4, 2025).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/758

复现步骤

  1. secrets中填入6个secrets: BACKEND_TOML, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, FRONTEND_ENV, FRONTEND_NAME, TG_FRONTEND_NAME
  2. 手动执行 Deploy Backend
  3. Deploy Backend for main 这步报错,执行错误

截取部分log

shell: /usr/bin/bash -e {0}
env:
  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
  CLOUDFLARE_ACCOUNT_ID: ***
  CLOUDFLARE_API_TOKEN: ***
##[endgroup***
 WARN  Ignoring not compatible lockfile at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/worker/pnpm-lock.yaml
Progress: resolved 1, reused 0, downloaded 0, added 0
 WARN  deprecated @simplewebauthn/types@10.0.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
Progress: resolved 71, reused 0, downloaded 60, added 0
Progress: resolved 178, reused 0, downloaded 164, added 0
Progress: resolved 274, reused 0, downloaded 226, added 0
Packages: +337
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 382, reused 0, downloaded 336, added 0
Progress: resolved 382, reused 0, downloaded 338, added 337, done
.../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}"
.../node_modules/core-js-pure postinstall: Done
.../esbuild@0.25.4/node_modules/esbuild postinstall$ node install.js
.../node_modules/workerd postinstall$ node install.js
.../esbuild@0.25.4/node_modules/esbuild postinstall: Done
.../node_modules/workerd postinstall: Done
.../sharp@0.33.5/node_modules/sharp install$ node install/check
.../sharp@0.33.5/node_modules/sharp install: Done

dependencies:
+ @aws-sdk/client-s3 3.888.0 (3.922.0 is available)
+ @aws-sdk/s3-request-presigner 3.888.0 (3.922.0 is available)
+ @simplewebauthn/server 10.0.1 (13.2.2 is available)
+ hono 4.10.4
+ jsonpath-plus 10.3.0
+ mimetext 3.0.27
+ postal-mime 2.6.0
+ resend 4.8.0 (6.4.0 is available)
+ telegraf 4.16.3
+ worker-mailer 1.1.5

devDependencies:
+ @cloudflare/workers-types 4.20251014.0
+ @eslint/js 9.18.0 (9.39.1 is available)
+ @simplewebauthn/types 10.0.0 (12.0.0 is available) deprecated
+ @types/node 22.19.0 (24.10.0 is available)
+ eslint 9.18.0 (9.39.1 is available)
+ globals 15.15.0 (16.5.0 is available)
+ typescript-eslint 8.46.3
+ wrangler 4.45.3

Done in 10s
##[error***Process completed with exit code 1.

预期行为

成功部署

部署方式

  • cli 部署
  • 用户界面部署
  • Github Action

浏览器环境

Originally created by @catfishlty on GitHub (Nov 4, 2025). Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/758 ## 复现步骤 1. secrets中填入6个secrets: `BACKEND_TOML`, `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN`, `FRONTEND_ENV`, `FRONTEND_NAME`, `TG_FRONTEND_NAME` 2. 手动执行 `Deploy Backend` 3. 在 `Deploy Backend for main` 这步报错,执行错误 截取部分log ``` shell: /usr/bin/bash -e {0} env: PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin CLOUDFLARE_ACCOUNT_ID: *** CLOUDFLARE_API_TOKEN: *** ##[endgroup***  WARN  Ignoring not compatible lockfile at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/worker/pnpm-lock.yaml Progress: resolved 1, reused 0, downloaded 0, added 0  WARN  deprecated @simplewebauthn/types@10.0.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. Progress: resolved 71, reused 0, downloaded 60, added 0 Progress: resolved 178, reused 0, downloaded 164, added 0 Progress: resolved 274, reused 0, downloaded 226, added 0 Packages: +337 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 382, reused 0, downloaded 336, added 0 Progress: resolved 382, reused 0, downloaded 338, added 337, done .../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}" .../node_modules/core-js-pure postinstall: Done .../esbuild@0.25.4/node_modules/esbuild postinstall$ node install.js .../node_modules/workerd postinstall$ node install.js .../esbuild@0.25.4/node_modules/esbuild postinstall: Done .../node_modules/workerd postinstall: Done .../sharp@0.33.5/node_modules/sharp install$ node install/check .../sharp@0.33.5/node_modules/sharp install: Done dependencies: + @aws-sdk/client-s3 3.888.0 (3.922.0 is available) + @aws-sdk/s3-request-presigner 3.888.0 (3.922.0 is available) + @simplewebauthn/server 10.0.1 (13.2.2 is available) + hono 4.10.4 + jsonpath-plus 10.3.0 + mimetext 3.0.27 + postal-mime 2.6.0 + resend 4.8.0 (6.4.0 is available) + telegraf 4.16.3 + worker-mailer 1.1.5 devDependencies: + @cloudflare/workers-types 4.20251014.0 + @eslint/js 9.18.0 (9.39.1 is available) + @simplewebauthn/types 10.0.0 (12.0.0 is available) deprecated + @types/node 22.19.0 (24.10.0 is available) + eslint 9.18.0 (9.39.1 is available) + globals 15.15.0 (16.5.0 is available) + typescript-eslint 8.46.3 + wrangler 4.45.3 Done in 10s ##[error***Process completed with exit code 1. ``` ## 预期行为 成功部署 ## 部署方式 - [ ] cli 部署 - [ ] 用户界面部署 - [x] Github Action ## 浏览器环境
kerem 2026-02-26 20:36:28 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@catfishlty commented on GitHub (Nov 4, 2025):

初步判断应该是cloudflare api token权限的问题

<!-- gh-comment-id:3484986887 --> @catfishlty commented on GitHub (Nov 4, 2025): 初步判断应该是cloudflare api token权限的问题
Author
Owner

@dreamhunter2333 commented on GitHub (Nov 5, 2025):

初步判断应该是cloudflare api token权限的问题

创建时选择 worker 的模板,给全部权限

<!-- gh-comment-id:3488841933 --> @dreamhunter2333 commented on GitHub (Nov 5, 2025): > 初步判断应该是cloudflare api token权限的问题 创建时选择 worker 的模板,给全部权限
Author
Owner

@catfishlty commented on GitHub (Nov 5, 2025):

使用 Deploy Frontend 或者 Deploy Frontend with page function 部署的时候会有下面的报错

Must specify a directory of assets to deploy. Please specify the [<directory>] argument in the `pages deploy` command, or configure `pages_build_output_dir` in your wrangler.toml file.

核心问题:
Deploy Frontend with page function 这一个workflow依赖多出来的PAGE_TOML,在 #355 中新增加的功能,但是文档中没有体现

这也可以应征warning信息的内容
⛅️ wrangler 4.45.4
───────────────────
▲ [WARNING] Pages now has wrangler.toml support.

  We detected a configuration file at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/pages/wrangler.toml but it is missing the "pages_build_output_dir" field, required by Pages.
  If you would like to use this configuration file to deploy your project, please use "pages_build_output_dir" to specify the directory of static files to upload.
  Ignoring configuration file for now, and proceeding with project deploy.

更新:1,2问题解决,然后出现新问题,目前pages模块的部署会部署到preview环境而并非是production环境,另外部署前端 frontend和frontend_page_func是都需要部署的还是二选一?如果需要nopwa支持(Cloudflare Zero Trust支持),还可以利用action进行部署吗?

<!-- gh-comment-id:3489096915 --> @catfishlty commented on GitHub (Nov 5, 2025): 使用 `Deploy Frontend` 或者 `Deploy Frontend with page function` 部署的时候会有下面的报错 ``` Must specify a directory of assets to deploy. Please specify the [<directory>] argument in the `pages deploy` command, or configure `pages_build_output_dir` in your wrangler.toml file. ``` --- 核心问题: `Deploy Frontend with page function` 这一个workflow依赖多出来的`PAGE_TOML`,在 #355 中新增加的功能,但是文档中没有体现 ``` 这也可以应征warning信息的内容 ⛅️ wrangler 4.45.4 ─────────────────── ▲ [WARNING] Pages now has wrangler.toml support. We detected a configuration file at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/pages/wrangler.toml but it is missing the "pages_build_output_dir" field, required by Pages. If you would like to use this configuration file to deploy your project, please use "pages_build_output_dir" to specify the directory of static files to upload. Ignoring configuration file for now, and proceeding with project deploy. ``` --- 更新:1,2问题解决,然后出现新问题,目前pages模块的部署会部署到preview环境而并非是production环境,另外部署前端 frontend和frontend_page_func是都需要部署的还是二选一?如果需要nopwa支持(Cloudflare Zero Trust支持),还可以利用action进行部署吗?
Author
Owner

@dreamhunter2333 commented on GitHub (Nov 7, 2025):

部署到preview环境

需要指定 production 分支 为 production

<!-- gh-comment-id:3500941532 --> @dreamhunter2333 commented on GitHub (Nov 7, 2025): > 部署到preview环境 需要指定 production 分支 为 production
Author
Owner

@dreamhunter2333 commented on GitHub (Nov 7, 2025):

使用 Deploy Frontend 或者 Deploy Frontend with page function 部署的时候会有下面的报错

Must specify a directory of assets to deploy. Please specify the [<directory>] argument in the `pages deploy` command, or configure `pages_build_output_dir` in your wrangler.toml file.

核心问题: Deploy Frontend with page function 这一个workflow依赖多出来的PAGE_TOML,在 #355 中新增加的功能,但是文档中没有体现

这也可以应征warning信息的内容
⛅️ wrangler 4.45.4
───────────────────
▲ [WARNING] Pages now has wrangler.toml support.

  We detected a configuration file at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/pages/wrangler.toml but it is missing the "pages_build_output_dir" field, required by Pages.
  If you would like to use this configuration file to deploy your project, please use "pages_build_output_dir" to specify the directory of static files to upload.
  Ignoring configuration file for now, and proceeding with project deploy.

更新:1,2问题解决,然后出现新问题,目前pages模块的部署会部署到preview环境而并非是production环境,另外部署前端 frontend和frontend_page_func是都需要部署的还是二选一?如果需要nopwa支持(Cloudflare Zero Trust支持),还可以利用action进行部署吗?

pages 代理 或者 直接部署 worker with assset 就是为了 Cloudflare Zero Trust

<!-- gh-comment-id:3500945681 --> @dreamhunter2333 commented on GitHub (Nov 7, 2025): > 使用 `Deploy Frontend` 或者 `Deploy Frontend with page function` 部署的时候会有下面的报错 > > ``` > Must specify a directory of assets to deploy. Please specify the [<directory>] argument in the `pages deploy` command, or configure `pages_build_output_dir` in your wrangler.toml file. > ``` > > 核心问题: `Deploy Frontend with page function` 这一个workflow依赖多出来的`PAGE_TOML`,在 [#355](https://github.com/dreamhunter2333/cloudflare_temp_email/pull/355) 中新增加的功能,但是文档中没有体现 > > ``` > 这也可以应征warning信息的内容 > ⛅️ wrangler 4.45.4 > ─────────────────── > ▲ [WARNING] Pages now has wrangler.toml support. > > We detected a configuration file at /home/runner/work/cloudflare_temp_email/cloudflare_temp_email/pages/wrangler.toml but it is missing the "pages_build_output_dir" field, required by Pages. > If you would like to use this configuration file to deploy your project, please use "pages_build_output_dir" to specify the directory of static files to upload. > Ignoring configuration file for now, and proceeding with project deploy. > ``` > > 更新:1,2问题解决,然后出现新问题,目前pages模块的部署会部署到preview环境而并非是production环境,另外部署前端 frontend和frontend_page_func是都需要部署的还是二选一?如果需要nopwa支持(Cloudflare Zero Trust支持),还可以利用action进行部署吗? pages 代理 或者 直接部署 worker with assset 就是为了 Cloudflare Zero Trust
Author
Owner

@dreamhunter2333 commented on GitHub (Nov 7, 2025):

前端 frontend和frontend_page_func是都需要部署的还是二选一

前端 frontend pages worker(带前端) 三选一即可

<!-- gh-comment-id:3500946848 --> @dreamhunter2333 commented on GitHub (Nov 7, 2025): > 前端 frontend和frontend_page_func是都需要部署的还是二选一 前端 frontend pages worker(带前端) 三选一即可
Author
Owner

@catfishlty commented on GitHub (Nov 7, 2025):

需要指定 production 分支 为 production

这一步处理完就可以正常部署了,感谢回复。

还是建议文档里面加一下PAGE_TOML的描述。

<!-- gh-comment-id:3503448369 --> @catfishlty commented on GitHub (Nov 7, 2025): > 需要指定 production 分支 为 production 这一步处理完就可以正常部署了,感谢回复。 还是建议文档里面加一下`PAGE_TOML`的描述。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudflare_temp_email#284
No description provided.