Deploy script removes github pages custom domain
See original GitHub issueWhen using these to deploy to github :
git commit -am "Save local changes"
git checkout -B gh-pages
git add -f build
git commit -am "Rebuild website"
git filter-branch -f --prune-empty --subdirectory-filter build
git push -f origin gh-pages
git checkout -
Github loses the custom domain setting
Note : I think it’s due to the -B
option in git checkout -B gh-pages
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Deploying seems to overwrite custom domain #213 - GitHub
I am deploying a GatsbyJS site to GitHub pages with this command: gatsby build --prefix-paths && gh-pages -d public -b master.
Read more >gh-pages -d dist overwrites custom domain · Issue #127 - GitHub
When I use my npm script like so "deploy": "npm run build:prod ... I noticed that create-react-app was removing the CNAME from the...
Read more >Pushing changes to GitHub Pages branch removes custom ...
As advertised: pushing changes to GitHub Pages branch removes custom domain setting. This could be a problem with another repo sharing the ...
Read more >[v2] Deploying to GitHub pages removes custom domain from ...
If you deploy to GitHub pages with a custom domain, the custom domain will be removed from the repository settings and you need...
Read more >Deploying is overwriting custom domain on GitHub Pages #529
Push to the repo and trigger CI -> the custom domain is removed from the Pages config. Expected behaviour. Does not remove the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also
gh-pages
will overwrite theCNAME
file, because it just always pushes everything from the build folder to thegh-pages
branch.A simple workaround for this problem is to add a
CNAME
file with the custom domain inside thepublic
folder in your project and it will be copied to the build and deployed.@dsernst yeah, not sure why I didn’t put my original script. And in retrospect I regret my decision.