question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploying through Github User Pages

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
aaronlnacommented, 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.

0reactions
Timercommented, Dec 5, 2017

Thanks @denkristoffer !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying to GitHub Pages - Codecademy
Deploying to GitHub Pages is automatic. Once it's set up, deploying happens whenever you push your local changes to your remote, GitHub-hosted repository....
Read more >
Creating a GitHub Pages site
On GitHub, navigate to your site's repository. · Decide which publishing source you want to use. · Create the entry file for your...
Read more >
GitHub Pages | Websites for you and your projects, hosted ...
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
Read more >
Quickstart for GitHub Pages - GitHub Docs
GitHub Pages are public webpages hosted and published through GitHub. The quickest way to get up and running is by using the Jekyll...
Read more >
Marketplace Actions Deploy to GitHub Pages
folder, The folder in your repository that you want to deploy. If your build script compiles into a directory named build you'd put...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found