skwidbreth
skwidbreth

Reputation: 8414

Heroku - push subtrees to different apps

I have a two-part app (a Phoenix API and a React front-end) that I want to deploy to Heroku... the back-end and front-end need to run on separate servers, but the current app structure is like so:

app/
  |
  + Phoenix/
  |
  + React/
  |
  + .git/

So both parts of the app are in the same git repo.

Within app/, I created two different Heroku apps - I'll call them phoenix-heroku-app and react-heroku-app. My plan is to use the git subtree method to push these apps up to Heroku, but I'm not sure how to specify where each should go.

When I run heroku apps, this correctly lists

phoenix-heroku-app
react-heroku-app

So they're both there... but when I use a command like

$ git subtree push --prefix Phoenix heroku master
$ git subtree push --prefix React heroku master

what is the syntax to point each of these pushes toward the correct app?

Upvotes: 2

Views: 612

Answers (1)

skwidbreth
skwidbreth

Reputation: 8414

Following @bouteillebleu's suggestion, I was able to handle this like so...

First, I needed to add Heroku endpoints for the two apps in the parent directory -

$ git remote add phoenix-heroku-app https://git.heroku.com/phoenix-heroku-app.git
$ git remote add react-heroku-app https://git.heroku.com/react-heroku-app.git

Then I just needed to run

$ git subtree push --prefix Phoenix phoenix-heroku-app master
$ git subtree push --prefix React react-heroku-app master

and it was good to go.

Upvotes: 2

Related Questions