Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Jan 4, 2026

Problem

actions/upload-pages-artifact@v3 在 self-hosted runner 上容易卡住,导致 CD 部署失败。

Solution

对于 self-hosted runner,改用直接 git push 到 gh-pages 分支的方式部署:

  • 移除 actions/upload-pages-artifact 步骤
  • 移除 deploy-pages-fast job
  • build-fast job 中直接 git push 到 gh-pages 分支
  • 移除不再需要的 GNU tar 安装步骤

Note

合并后需要在 GitHub 仓库设置中配置 Pages 部署源为 gh-pages 分支:
Settings -> Pages -> Build and deployment -> Source: Deploy from a branch -> Branch: gh-pages

GitHub-hosted runner 路径保持不变(使用 actions/deploy-pages)。

- Replace actions/upload-pages-artifact with direct git push to gh-pages branch
- Remove deploy-pages-fast job (deployment now in build-fast)
- Remove GNU tar setup (no longer needed)

This avoids the upload-pages-artifact action hanging on self-hosted runners.
@Gaubee Gaubee merged commit 7c81cf1 into main Jan 4, 2026
5 checks passed
@Gaubee Gaubee deleted the fix/cd-pages-deploy branch January 4, 2026 06:42
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.

2 participants