如何强制GitHub Pages构建?

问题描述:

每个GitHub存储库都可以拥有( GitHub Pages 网站,可以用Jekyll建造.每次您推送新提交时,GitHub都会构建站点.
有没有办法在不推动新提交的情况下强制刷新Github Pages网站?

Every GitHub repository can have (or be) a GitHub Pages website, that can be built with Jekyll. GitHub builds the site every time you push a new commit.
Is there a way to force the refresh of the Github Pages website without pushing a new commit?

来自GitHub支持,2014年6月7日:

From GitHub support, 2014-06-07:

当前无法在不将提交推送到适当分支的情况下手动触发重建.

It's not currently possible to manually trigger a rebuild, without pushing a commit to the appropriate branch.


正如Andy在评论中指出的那样,您可以使用以下命令来推送空提交:


As Andy pointed out in the comments, you can push an empty commit with the command:

git commit -m 'rebuild pages' --allow-empty
git push origin <branch-name>

感谢GitHub Actions,触发每日发布相当容易: https://stackoverflow.com/a/61706020/4548500 .