Skip to content

Commit

Permalink
ci: big ⚠️ to ensure the CNAME file always exist
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Oct 19, 2023
1 parent 5fab767 commit 22deaf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ 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 issue 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"
git push origin +gh-pages
3 changes: 3 additions & 0 deletions ci/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 that may entail security issue 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')

Expand Down

0 comments on commit 22deaf8

Please sign in to comment.