Search code examples
reactjsdeploymentgithub-pagescreate-react-app

Losing settings for personal domain on GitHub after deploy React app


My problem

I losing settings for personal domain on GitHub after I deploy React app.

I have my personal domain: https://serdyuchenko.com/

And after each deploy, I automatically go to default domain: https://anton415.github.io/

And I need go to GitHub settings and change my domain again.

My Question

How I can stop auto return to default GitHub domain, after each React app deploy?

What I do

Link to my react app on GitHub

I use this instruction for deploy React app on GitHub

I add 'homepage' field for my project in package.json:

"homepage": "https://serdyuchenko.com/"

I have 'gh-pages' branch and I add deploy's script in package.json:

"deploy": "gh-pages -b master -d build",

What I don't know

I don't know is it problem with create-react-app or with github-pages. Or I need add some settings for my deploy's script?


Solution

  • It looks like your deploy deletes the CNAME file in your repository. GitHub Pages sets the custom domain according to the contents of the CNAME file. If there is no CNAME file in the repository then GitHub sets the default GitHub Pages domain.

    • See commit history of your CNAME here.

    • See GitHub Pages custom domain troubleshooting page here.