Skip to content
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

Deploy script removes github pages custom domain #654

Closed
sylvainbannier opened this issue Sep 15, 2016 · 8 comments · Fixed by #959
Closed

Deploy script removes github pages custom domain #654

sylvainbannier opened this issue Sep 15, 2016 · 8 comments · Fixed by #959
Milestone

Comments

@sylvainbannier
Copy link

sylvainbannier commented Sep 15, 2016

When 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.

@fson
Copy link
Contributor

fson commented Sep 16, 2016

We're likely going to change the GitHub deployment instructions to use the simpler docs folder in master branch approach (#520).

The new set of commands to deploy will be basically:

npm run build
mv build docs
git add docs
git commit -m "Rebuild website"
git push origin master

I think this issue will be fixed by that change?

@sylvainbannier
Copy link
Author

@fson it think so. thanks.

@Janpot
Copy link
Contributor

Janpot commented Oct 3, 2016

gh-pages in combination with following script seems to work pretty well for me:

"deploy": "npm run build && gh-pages -d build"

this pushes the build folder to the gh-pages branch. Basically turning that set of comands into a one liner.

Edit:

Just saw the discussion under #520. gh-pages could be the solution they were looking for.

@fson
Copy link
Contributor

fson commented Oct 3, 2016

gh-pages looks like what we want indeed, so we just need to document the command in Create React App and test that it works. @Janpot would you be interested in making a pull request?

@Janpot
Copy link
Contributor

Janpot commented Oct 4, 2016

@fson done in #841

@fson
Copy link
Contributor

fson commented Oct 4, 2016

Also gh-pages will overwrite the CNAME file, because it just always pushes everything from the build folder to the gh-pages branch.

A simple workaround for this problem is to add a CNAME file with the custom domain inside the public folder in your project and it will be copied to the build and deployed.

@dsernst
Copy link
Contributor

dsernst commented Oct 25, 2016

I believe this is no longer an issue. I thought I was coming across it, but the problem was that I had not re-run npm run build since adding the CNAME file to public/.

Using @Janpot's recommended deploy script:

"deploy": "npm run build && gh-pages -d build"

rather than the readme's recommendation

"deploy": "gh-pages -d build"

would have saved me 20 minutes of debugging the problem.

¯\_(ツ)_/¯

@Janpot
Copy link
Contributor

Janpot commented Oct 25, 2016

@dsernst yeah, not sure why I didn't put my original script. And in retrospect I regret my decision.

@fson fson modified the milestones: 0.8.0, 1.0.0 Nov 23, 2016
mmoscosa added a commit to mmoscosa/Bardho that referenced this issue Sep 20, 2017
kevinsqi added a commit to kevinsqi/microharmonic that referenced this issue Dec 18, 2017
daryllxd added a commit to daryllxd/braindump that referenced this issue Mar 30, 2018
godspeedelbow added a commit to godspeedelbow/bess.nu that referenced this issue May 17, 2018
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
@lock lock bot unassigned fson Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants