Anton Serdyuchenko
Anton Serdyuchenko

Reputation: 142

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?

Upvotes: 0

Views: 262

Answers (2)

Since you are using gh-pages for React app deployment

– just put CNAME file with your domain into public folder.

That should allow github pages to fetch the details without overiding.

an example can be found here. https://github.com/AmarnathN/deroute/blob/master/CNAME

Upvotes: 2

faround
faround

Reputation: 96

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.

Upvotes: 1

Related Questions