- Create an empty repository, with name of
starter-project
.
- In your folder
starter-project
, add remote and push,
git remote add origin https://github.com/zcemycl/starter-project
git push --set-upstream origin master
- Install gh-pages package, this will create
node_modules
and package.json
,
yarn add gh-pages
- Edit
package.json
,
{
"homepage":"https://zcemycl.github.io/starter-project/", ####
"name": "starter-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"gh-pages": "^3.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"predeploy":"npm run build", ####
"deploy":"gh-pages -d build",####
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
- Deploy the application, and run whenever you need update the web app,
npm run deploy
- I will add, commite and push again normally.