Set up local deploy for staging and production envs
Create different version of apps on heroku via dashboard
Add buildpack to settings:
https://buildpack-registry.s3.amazonaws.com/buildpacks/mars/create-react-app.tgz
If deploying a React app, follow this tutorial: https://www.geeksforgeeks.org/how-to-deploy-react-app-to-heroku/
Add the remote url of each env locally:
Prod:
git remote add prod <heroku-git-url>
Staging:
git remote add staging <heroku-git-url>
Add to scripts in package.json
"deploy:staging": "git push staging", "deploy:prod": "git push prod"
View remotes with:
git remote -v
GOTCHAS
Remove homepage if available in package.json
Add a start script that starts the server
DOMAIN ADDITION
Add domain to project:
heroku domains:add <domain name>
Print available domains
heroku domains
Add CNAME plus target to hosting provider
Confirm that domain has been enabled with
host <domain name>
Last updated
Was this helpful?