Skip to content

Instantly share code, notes, and snippets.

@rfoel
Last active December 22, 2017 01:06
Show Gist options
  • Save rfoel/d850aa458942f39631802a1f1559b857 to your computer and use it in GitHub Desktop.
Save rfoel/d850aa458942f39631802a1f1559b857 to your computer and use it in GitHub Desktop.
Deploy on Heroku using single repository

create app on heroku

heroku create name-api --remote name-api
heroku create name-web --remote name-web

heroku ps:scale web=1 --remote name-api
heroku ps:scale web=1 --remote name-web

first push with refs

git push name-api `git subtree split --prefix api master`:refs/heads/master --force
git push name-web `git subtree split --prefix web master`:refs/heads/master --force

then you can run without it

git push name-web `git subtree split --prefix web master`:master --force
git push name-api `git subtree split --prefix api master`:master --force

run commands with flag

heroku run rake db:seed --app name-api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment