-
Notifications
You must be signed in to change notification settings - Fork 191
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
Deploying seems to overwrite custom domain #213
Comments
also getting this bug... |
It seems you need to include a file named In my case, the
Credit goes to this comment. |
Just adapt this lines to your DEPLOYMENT script var ghpages = require('gh-pages');
var fs = require('fs');
fs.writeFile('dist/CNAME', "your-custom-domain.com", function(err) {});
ghpages.publish('dist', function(err) {}); |
I came across the same issue and just added a npm script for this before publishing. "add-domain": "echo \"customdomain.com\" > build/CNAME", |
If you use gh-pages for React app deployment – just put |
Github pages custom url was reset after each deployment For details see tschaub/gh-pages#213
build script needs to write a file called CNAME to the publish directory. More info: tschaub/gh-pages#213 (comment)
Github pages custom url was reset after each deployment For details see tschaub/gh-pages#213
For angular 8. |
It would be nice if this behavior was documented in the README. |
Add CNAME to public dir to config custom domain.
Thank you it helped |
If you are using Gatsby just create a |
For Hugo, I moved the CNAME file to the "public" directory as that is where the static site resources and assets are built by the GitHub Action. |
Yes, the CNAME file is in the root in gh-pages branch with the domain as the only text inside. |
same problem here: CNAME file is in the build/ folder, but the custom domain keeps resetting... |
same problem here. CNAME available in the gh-pages branch root folder and the GitHub Pages custom domain keeps resetting on every deploy |
I was also having this same issue as @dimitarangelko. It turned out the issue was that there were slightly different formats of the link in the CNAME files and In the package.json "add-domain": script line it was "add-domain": "echo "https://mypage.app\" > build/CNAME", public/CNAME (in master): mypage.app made sure that the correct domain was set up in github pages before doing this and pulled them in in the gh-pages branch. Saved it all and ran npm run deploy and it finally didn't replace it! |
…E into public folder
CNAME file is in my main and gh-pages branches, and at the root of each. But this still happens. Any ideas? I'm building a Vite React app, I use GitHub actions to build and push to gh-pages branch. |
For Hugo (as mentioned above) you can add the CNAME like so from the root of your directory:
Adding this because I wasn't sure exactly where the public directory should be, and I didn't know what a CNAME file contained. |
Following the suggestions as mentioned here: tschaub/gh-pages#213
I have the same problem using Hugo.
I think this worked fine before the option |
I am using Sphinx, but I fixed this by adding CNAME to the directory from which Pages deploys the source. E.g., if your |
I do that. I follow the file to show to you and noticing that every deploy removes de CNAME file, but this actions is not setting by me: https://github.com/fguisso/fguisso.github.io/commits/gh-pages/CNAME |
Per tschaub/gh-pages#213 (comment), otherwise deploying will overwrite CNAME record
gh-pages: tschaub/gh-pages#213
I am deploying a GatsbyJS site to GitHub pages with this command:
gatsby build --prefix-paths && gh-pages -d public -b master
I need to push to the master branch because it's a user site (rather than a project site). This works but each time I do it, the repo's "Custom domain" setting is reset. This means after every deploy I need to go into the settings and re-enter the custom domain. No idea if this is a bug or if I'm just missing something obvious.
The text was updated successfully, but these errors were encountered: