Replies: 12 comments 11 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem. Every time I use the UI to add the custom domain and hit Save, it is not added |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Can anyone help? |
Beta Was this translation helpful? Give feedback.
-
I had a similar issue with my Angular app. I had to add "src/CNAME" to the angular.json file and then run a new build. This added the CNAME file in the build output directory, and when I pushed it to the remote repo the custom domain was intact. The issue I'm having now is that my app won't run with my (verified) custom domain. When I remove the CNAME file it works. I can't figure it out, nor have I been able to find any solutions. |
Beta Was this translation helpful? Give feedback.
-
Copilot suggests this, though I'm just trying to help, not sure about this, The issue you're experiencing is likely due to the To fix this, you can modify your deploy script to automatically create the CNAME file each time you deploy. Here's how you can do it:
Here's an example of how you can modify your "scripts": {
"predeploy": "npm run build && cp CNAME build/",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
// ...
} In this example, the Now, each time you run |
Beta Was this translation helpful? Give feedback.
-
I found the problem I was having was due to the order in which I was making modifications. I would push to the repo, then add the subdomain. When I launched from gh pages, it worked fine. But whenever I would push a new build to the repo I found the subdomain was missing. The step I was skipping was to sync the local repo and the remote repo. I had to run a pull after adding the subdomain, which added the CNAME file to the local repo. From then on, I haven't had any issues. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Hey Github Team. This CNAME file requirement is not documented anywhere. If you use the "Deploy from Branch (Classic Experience)" without a CNAME file, it nukes your CNAME setting in pages every single time you deploy. Our project's custom domain was going 404 with every deploy, because on deploy it erased the custom domain setting in the settings. That is, of course, until I added a CNAME file. Once the CNAME file landed in the Maybe this is supposed to be a legacy requirement that is no longer needed, because it's not documented and because the first response here said delete the CNAME file. But that is clearly wrong. The reality is that file is required, and this classic experience w/ a custom domain breaks without the CNAME file. (And no, this is not related to DNS. The DNS didn't change for the fix. The only thing that has changed is that CNAME file) |
Beta Was this translation helpful? Give feedback.
-
If you are building your website with Quarto, here is a useful resource: |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
any update? T_T |
Beta Was this translation helpful? Give feedback.
-
Currently i am having same issue custom domains clears every time i npm run deploy |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
This is my repo link: https://github.com/eszabo12/eszabo12.github.io
My custom domain is http://elleszabo.com
I'm using gh-pages branch created by the npm gh-pages package. When I deploy from my local computer to the remote using npm run deploy, it works and it updates to master. However, when I do this it says that it's being deployed at https://eszabo12.github.io instead of my custom domain, which I had already saved and had been approved.
Every time I deploy, the custom domain field in the github pages setting page clears, and I have to completely reenter it in order for the site to deploy on my custom domain. The "save" button is misleading because it really does not save at all. I have a CNAME file in the root of my directory, and have done everything I thought I was supposed to do. It works when I reenter the custom domain, but how do I get it to save the domain between deploys?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions