Replies: 6 comments 9 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.
-
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