[GH-ISSUE #313] 通过Github Action部署后,cf里始终是preview分支 #98

Closed
opened 2026-02-26 20:35:37 +03:00 by kerem · 6 comments
Owner

Originally created by @battlewolf9527 on GitHub (Jun 14, 2024).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/313

通过Github Action部署后,cf里始终是preview分支

Originally created by @battlewolf9527 on GitHub (Jun 14, 2024). Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/313 通过Github Action部署后,cf里始终是preview分支
kerem closed this issue 2026-02-26 20:35:38 +03:00
Author
Owner

@dreamhunter2333 commented on GitHub (Jun 14, 2024):

创建pages 时需要指定生产分支,请指定为 production

<!-- gh-comment-id:2167703996 --> @dreamhunter2333 commented on GitHub (Jun 14, 2024): 创建pages 时需要指定生产分支,请指定为 production
Author
Owner

@antergone commented on GitHub (Jun 14, 2024):

创建pages 时需要指定生产分支,请指定为 production

如果是上传zip包是可以指定的,github action我也没找到指定的地方。我是通过API的方式更新的。

curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/{account_id}/pages/projects/{project_name}" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  --data "{\"production_branch\": \"production\"}"

文档:https://developers.cloudflare.com/pages/configuration/branch-build-controls/#production-branch-control

如果方案没错的话, @dreamhunter2333 看看是否可以新增到Workflow里

<!-- gh-comment-id:2168247329 --> @antergone commented on GitHub (Jun 14, 2024): > 创建pages 时需要指定生产分支,请指定为 production 如果是上传zip包是可以指定的,github action我也没找到指定的地方。我是通过API的方式更新的。 ``` curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/{account_id}/pages/projects/{project_name}" \ -H "Authorization: Bearer <API_TOKEN>" \ -H "Content-Type: application/json" \ --data "{\"production_branch\": \"production\"}" ``` 文档:https://developers.cloudflare.com/pages/configuration/branch-build-controls/#production-branch-control 如果方案没错的话, @dreamhunter2333 看看是否可以新增到Workflow里
Author
Owner

@dreamhunter2333 commented on GitHub (Jun 14, 2024):

创建pages 时需要指定生产分支,请指定为 production

如果是上传zip包是可以指定的,github action我也没找到指定的地方。我是通过API的方式更新的。


curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/{account_id}/pages/projects/{project_name}" \

  -H "Authorization: Bearer <API_TOKEN>" \

  -H "Content-Type: application/json" \

  --data "{\"production_branch\": \"production\"}"

文档:https://developers.cloudflare.com/pages/configuration/branch-build-controls/#production-branch-control

如果方案没错的话, @dreamhunter2333 看看是否可以新增到Workflow里

OK 我有空把这个作为一个参数

<!-- gh-comment-id:2168249929 --> @dreamhunter2333 commented on GitHub (Jun 14, 2024): > > 创建pages 时需要指定生产分支,请指定为 production > > > > 如果是上传zip包是可以指定的,github action我也没找到指定的地方。我是通过API的方式更新的。 > > ``` > > curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/{account_id}/pages/projects/{project_name}" \ > > -H "Authorization: Bearer <API_TOKEN>" \ > > -H "Content-Type: application/json" \ > > --data "{\"production_branch\": \"production\"}" > > ``` > > 文档:https://developers.cloudflare.com/pages/configuration/branch-build-controls/#production-branch-control > > > > 如果方案没错的话, @dreamhunter2333 看看是否可以新增到Workflow里 > > > > > > OK 我有空把这个作为一个参数
Author
Owner

@battlewolf9527 commented on GitHub (Jun 15, 2024):

嗯,我没有上传代码,只是创建了pages,然后就用github action部署了

<!-- gh-comment-id:2169188201 --> @battlewolf9527 commented on GitHub (Jun 15, 2024): 嗯,我没有上传代码,只是创建了pages,然后就用github action部署了
Author
Owner

@dreamhunter2333 commented on GitHub (Jun 15, 2024):

嗯,我没有上传代码,只是创建了pages,然后就用github action部署了

应该是创建的时候指定的生产分支不是production

<!-- gh-comment-id:2169195419 --> @dreamhunter2333 commented on GitHub (Jun 15, 2024): > 嗯,我没有上传代码,只是创建了pages,然后就用github action部署了 应该是创建的时候指定的生产分支不是production
Author
Owner

@dreamhunter2333 commented on GitHub (Jun 28, 2024):

已增加 FRONTEND_BRANCH,参考

https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/vitepress-docs/docs/zh/guide/github-action.md

<!-- gh-comment-id:2197150411 --> @dreamhunter2333 commented on GitHub (Jun 28, 2024): 已增加 `FRONTEND_BRANCH`,参考 https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/vitepress-docs/docs/zh/guide/github-action.md
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#98
No description provided.