Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Deploying to GitHub pages removes custom domain from repository settings #3889

Closed
Alex1304 opened this issue Dec 6, 2020 · 6 comments
Closed
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@Alex1304
Copy link
Contributor

Alex1304 commented Dec 6, 2020

🐛 Bug Report

If you deploy to GitHub pages with a custom domain, the custom domain will be removed from the repository settings and you need to re-add it after every deploy.

Have you read the Contributing Guidelines on issues?

Yes I did.

To Reproduce

  1. In your GitHub repository settings,
    configure a custom domain for GitHub pages
  2. In docusaurus.config.js, set url to your custom domain, with / as baseUrl
  3. Follow the Deployment guide for GitHub pages
  4. Run yarn deploy

Expected behavior

It should deploy the site at the custom domain and not modify the repository settings

Actual Behavior

It deploys the site at the default github.io domain, if you go back to the GitHub repository settings you can notice the custom domain was removed, you need to manually re-add it.

Your Environment

Docusaurus v2.0.0-alpha.70

Reproducible Demo

https://github.com/Alex1304/botrino

@Alex1304 Alex1304 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Dec 6, 2020
@slorber
Copy link
Collaborator

slorber commented Dec 7, 2020

It should deploy the site at the custom domain and not modify the repository settings

I don't understand what you mean by "not modify the repository settings".

I don't see a static/CNAME file on your site's repo, this is required afaik for GH pages custom domains, as documented.

image

If you feel like we could document this better, don't hesitate to submit a PR please

@Alex1304
Copy link
Contributor Author

Alex1304 commented Dec 7, 2020

Indeed I somehow completely missed this information regarding the CNAME file, not sure how it happened. The issue I'm experiencing is actually documented here https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/troubleshooting-custom-domains-and-github-pages#cname-errors

If you feel like we could document this better, don't hesitate to submit a PR please

I don't know if it would be relevant to highlight this section in a :::info box or something like that, if so I don't mind attempting a PR for it.

@Alex1304 Alex1304 closed this as completed Dec 7, 2020
@slorber
Copy link
Collaborator

slorber commented Dec 7, 2020

yes using an :::info box could be helpful, please send a doc PR :)

@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 10, 2022
ding-swe added a commit to ding-swe/ding-swe.github.io that referenced this issue Jul 16, 2022
JoshStrobl added a commit to BuddiesOfBudgie/docs that referenced this issue Jul 22, 2023
@greenpau
Copy link

greenpau commented Mar 6, 2024

I am running into this issue too. The repo is here: https://github.com/authcrunch/authcrunch.github.io

I have CNAME files in all branches, including gh-pages. However, once I deploy, the custom domain setting in "Settings", "Pages" gets cleared.

What is the fix?

@slorber
Copy link
Collaborator

slorber commented Mar 6, 2024

@greenpau how is this the same issue. The op above forgot to create a static/CNAME, and once they did the issue was fixed.

If you have an issue despite having a CNAME file then it's a different problem.

And in practice I do see your custom domain not being "cleared": https://docs.authcrunch.com/

@greenpau
Copy link

greenpau commented Mar 6, 2024

I fixed the issue by adding “static/CNAME” file. Previously, I only had CNAME at the root of the directory tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

4 participants