Skip to content

fix(cd): trigger GitHub Pages deployment via API after git push - #152

Closed
Gaubee wants to merge 1 commit into
mainfrom
fix/cd-pages-api
Closed

Gaubee wants to merge 1 commit into
mainfrom
fix/cd-pages-api

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Problem

上一个 PR (#151) 使用 git push 到 gh-pages 分支解决了 upload-pages-artifact 卡住的问题,但需要手动配置 GitHub Pages 从分支部署,且无法利用 GitHub Actions 部署的速度优势。

Solution

混合方案:

  1. git push 到 gh-pages 分支(可靠,不会卡住)
  2. GitHub API 触发 Pages 部署(快速,使用 GitHub CDN)

这样既避免了 upload-pages-artifact 的问题,又能保持 GitHub Actions 部署的速度。

Changes

  • 将 "Deploy to GitHub Pages" 步骤拆分为两步:
    • Push to gh-pages branch: git push 到 gh-pages
    • Trigger GitHub Pages deployment: 调用 GitHub Pages API 触发部署

- Push to gh-pages branch (reliable, no hanging)
- Trigger deployment via GitHub Pages API (fast, uses GitHub CDN)
- Best of both worlds: reliable upload + fast deployment
@Gaubee

Gaubee commented Jan 4, 2026

Copy link
Copy Markdown
Contributor Author

不再需要 - 已配置从 gh-pages 分支部署,git push 会自动触发部署。

@Gaubee Gaubee closed this Jan 4, 2026
@Gaubee
Gaubee deleted the fix/cd-pages-api branch January 4, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant