Github Pages 在部署时删除自定义 url

Github Pages removes custom url on deploy

我有一个设置了自定义域的 GitHub Pages 站点。每当我提交并部署到该站点时,我都会丢失自定义域并且必须进入回购设置并重新添加。

有人知道为什么 Github 这样做以及如何让它停止吗?

如果您使用的是自定义域,请检查您的 CNAME 文件是否在存储库的根目录中包含您的域名。 (CNAME 文件名必须大写)

来自docs

Custom domains are stored in a CNAME file in the root of your repository. You can add or update your custom domain through your repository settings.

勾选 GitHub Troubleshooting custom domains