Skip to content

Commit

Permalink
ci: big ⚠️ to ensure the CNAME file is always there
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Oct 19, 2023
1 parent 5fab767 commit ec9c5b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
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 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')

Expand Down

0 comments on commit ec9c5b0

Please sign in to comment.