Search code examples
reactjsgithubgithub-pages

Deploying a react app @ username.github.io


I am trying to deploy a react app at username.gihub.io

There are 2 main issues

  1. Whenever I try to build an application in react with gh-pages and deploy it goes to the branch gh-pages.
  2. Gihub always serves from the branch master, if the repo name is username.github.io (cannot be changed )

Has anyone deployed a react app in this url. If so, tell me how did you do it?

(Other than drag and drop build folder to master )

Image : enter image description here


Solution

  • Easiest way to deploy using GitHub now is by the new deploy from docs folder found here at the end of the page.

    You should be able to tweak your app to run build into the docs folder, way less headache than trying to get regular github-pages working imo.

    For fast sanity checking you can also drag your app into /docs