Works only if react app is created using create-react-app
- Setup .gitignore file
- Ensure either package-lock.json or yarn.lock is deleted, only can have 1
- Init with git, ignore if already done
git init
- Add and commit
git add . && git commit -m "initial commit"
- Login to Heroku
heroku login
- Create heroku project with buildpack (project name will be the url)
heroku create project_name -b https://github.com/mars/create-react-app-buildpack.git
- url will be https://project_name.herokuapp.com
- if project_name is not given, random name will be given
- Set heroku environment variables
- view all configs
heroku config
- set environment variable if required
heroku config:set MY_KEY=KEY_VALUE
- view all configs
- Push to heroku
git push heroku master
- Open website
heroku open
- Check releases for version to rollback if required
heroku releases
- Rollback if neccessary
heroku rollback vxxx
- example heroku rollback v2