ci: big ⚠️ to ensure the CNAME file is always there

This commit is contained in:
Weihang Lo 2023-10-18 21:21:16 -04:00
parent 5fab767241
commit ec9c5b0b43
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
2 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,9 @@ jobs:
# Generate HTML for link redirections.
python3 "$GENERATE_PY"
git add *.html
# WARN: The CNAME file is for GitHub to redirect requests to the custom domain.
# Missing this may entail security hazard and domain takeover.
# See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain>
git add CNAME
git commit -m "Deploy $GITHUB_SHA to gh-pages"

View File

@ -39,6 +39,9 @@ def main():
mapped = "https://doc.rust-lang.org/cargo/reference/{}".format(name)
f.write(TEMPLATE.format(name=name, mapped=mapped))
# WARN: The CNAME file is for GitHub to redirect requests to the custom domain.
# Missing this may entail security hazard and domain takeover.
# See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain>
with open('CNAME', 'w') as f:
f.write('doc.crates.io')