Skip to content

Latest commit

 

History

History
73 lines (50 loc) · 1.75 KB

DEPLOYING.md

File metadata and controls

73 lines (50 loc) · 1.75 KB

Deployer's Guide

Heroku Setup

Creating server:

heroku create -n react-firebase-2021

Associating the server, if necessary:

git remote -v
# if this doesn't create a new "heroku" remote address...
# heroku git:remote -a react-firebase-2021

Customizing buildpacks:

heroku buildpacks
# if you see the nodejs buildpack, remove it:
# heroku buildpacks:remove heroku/nodejs

heroku buildpacks:add mars/create-react-app

Customizing the build:

heroku config:set NODE_MODULES_CACHE=false

Configuring env vars:

heroku config:set REACT_APP_FIREBASE_API_KEY="_______"
heroku config:set REACT_APP_FIREBASE_AUTH_DOMAIN="my-project-123.firebaseapp.com"
heroku config:set REACT_APP_FIREBASE_PROJECT_ID="my-project-123"
heroku config:set REACT_APP_FIREBASE_STORAGE_BUCKET="my-project-123.appspot.com"
heroku config:set REACT_APP_FIREBASE_MESSAGING_SENDER_ID="_______"
heroku config:set REACT_APP_FIREBASE_APP_ID="_______"
heroku config:set REACT_APP_FIREBASE_DATABASE_URL="https://my-project-123.firebaseio.com"

heroku config:set REACT_APP_GA_TRACKER_ID="UA-XXXXXXXXXX-1"
heroku config:set REACT_APP_GA_DEBUG_MODE="false"

NOTE: with the react buildpack, need to re-deploy AFTER setting env vars in order for them to be recognized

Firebase Setup

"This domain (react-firebase-2021.herokuapp.com) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab."

Deploying

Deploying:

git push heroku main
# if deploying from a branch:
# git push heroku mybranch:main

Deploying will run "scripts/build" from "package.json".

Visiting in the browser:

heroku open