- Clone the repo:
git clone https://github.com/hdehal/made-in-usa.git
-
Setup your "Stitch App" on MongoDB Stitch, create the database, etc.: https://docs.mongodb.com/stitch/procedures/create-stitch-app/
-
Create an API key: (your app) > Users > Providers > API Key (On) && Users > Add https://stitch.mongodb.com
-
Create a ".env" file in your root (made-in-usa) folder with:
REACT_APP_STITCH_API_KEY=<YOUR-API-KEY-HERE>
src/
βββ App.js
βββ index.css
βββ index.js
βββ components/
βββ about.js
βββ add.js
βββ addForm.js
βββ displayAlerts.js
βββ displayCount.js
βββ displayTable.js
βββ error.js
βββ home.js
βββ maps.js
βββ navigation.js
βββ scrollTop.js
βββ stitchAuth.js
βββ tableColumns.js
βββ twemoji.js
Assuming you have an existing working GitHub repository, and your local code is checked-in.
-
Run
yarn add -D gh-pages
to install gh-pages as a dev dependency -
Create CNAME file in the public/ folder)
Your CNAME file should look like this:
mywebsite.com
- Edit your
package.json
and add the following: If it's a GitHub repo:
"homepage": "https://<your_github_username>.github.io/st",
OR if it's a custom TLD/domain:
"homepage": "https://yourwebsite.com",
AND add your build and deploy scripts -- this will deploy your build
folder to a new branch it will automatically create for you called gh-pages
:
"scripts": {
"deploy": "yarn run build && gh-pages -d build",
}
- Add basename to your your routing:
-
Commit your changes to your normal repo
-
Create your username.github.io repo at https://pages.github.com
-
Configuring a custom domain for your GitHub Pages site: https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site
-
Run
yarn deploy
-- it will prompt you for your Github username/password and automatically create and push your build files to a new branchgh-pages
on your remote origin. -
You should shortly see your changes on either https://yourwebsite.com or https://your_github_username.github.io