In this tutorial, we'll introduce you to how you can deploy a react app on Github.
The step below is important! If you skip it, your app will not deploy correctly. Open your git bash cmd and apply this cmd:
git add .
git commit -m 'any word'
create a new repository in github without readme and other files only repository name
git remote add origin https://github.com/deepbag/your-repository-name.git
push -u origin main
The step below is important! If you skip it, your app will not deploy correctly. or for a GitHub user page:
Create React App uses the homepage field to determine the root URL in the built HTML file.
Now, whenever you run npm run build, you will see a cheat sheet with instructions on how to deploy to GitHub Pages.
To publish it at https://myusername.github.io/my-app, run:
npm install --save gh-pages
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
The predeploy script will run automatically before deploy is run.
npm run deploy
Finally, make sure GitHub Pages option in your GitHub project settings is set to use the gh-pages branch: