how to deploy 'test' and 'production' to 2 different heroku servers

51 Views Asked by At

I have a project managed by git, deployed on Heroku. I'd want to have a 'test' version, deployed on heroku-test, and a 'prod' version, deployed on heroku-prod.

What's the best practice to do this?

  1. Have 2 different branches, push just one

    Push 'test' to heroku-test, and 'prod' to heroku-prod. I should merge them when I want to replicate updates from test to prod. In this case, I should remember each time a merge, to set properly the .env variable 'environment' to 'test' or 'prod' ;

  2. Have just one master branch,

    push the whole repo to heroku-master and heroku-test, but each server will use a different branch ('test' or 'prod') as master

0

There are 0 best solutions below