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

Deploying through Github User Pages #3456

Closed
patrickhuang94 opened this issue Nov 16, 2017 · 5 comments
Closed

Deploying through Github User Pages #3456

patrickhuang94 opened this issue Nov 16, 2017 · 5 comments

Comments

@patrickhuang94
Copy link

Upon reading the create-react-app docs, I only know how to deploy via gh-pages by adding a "homepage" section in my package.json. However, that requires the domain name to be <username>.github.io/<repository_name>. I want to deploy via master, with my domain name being <username>.github.io, but Github isn't reading my /build folder correctly. My site is just showing the README.md file.

How do I force Github to look at my /build folder and display my site? I tried renaming /build to /docs which didn't work either.

@aaronlna
Copy link
Contributor

aaronlna commented Nov 26, 2017

There's a workaround here.

  1. Simply change your default branch for your project to something else like source.
  2. Change your deploy script to push to master branch: "deploy": "gh-pages -b master -d build".

That's all that is necessary. I just tested this a few minutes ago and it seems to be working just fine.

It would be nice if this case could be documented somewhere or even have the recommended script during build changed to this if the user is specifying a GitHub user page, instead of project page.

@Timer
Copy link
Contributor

Timer commented Nov 27, 2017

I'm no expert with gh-pages, but if this situation is unique as @aaronlna described I'd be open to a docs modification for this specific case.

@aaronlna
Copy link
Contributor

aaronlna commented Nov 27, 2017

Pull request: #3510

@denkristoffer
Copy link
Contributor

denkristoffer commented Nov 29, 2017

Since the PR has been merged I believe this can be closed 🙂

@Timer Timer closed this as completed Dec 5, 2017
@Timer
Copy link
Contributor

Timer commented Dec 5, 2017

Thanks @denkristoffer !

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants