Deployment with Heroku CLI
Deployment with Heroku CLI
Install Heroku CLI
Ubuntu / Debian apt-get
1
$ curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
npm
1
$ npm install -g heroku
Check installed version
1
$ heroku --version
Login Heroku
1
$ heroku login
Close browser after login success
Push code to Heroku
1 2
$ heroku git:remote -a paoloc-nomadcoffee-backend $ git push heroku master
Check Server logs
1
$ heroku logs --tail
Prisma Migrate to Heroku
Now a the server is deployed on Heroku, but database does not exist on the server. By following these steps, you will add a Postgres database and get migrate of the database schema.
Go to
ResourcestapSearch
Postgreson Add-ons search and chooseHeroku PostgresSelect thePlan name(Hobby Dev - Free)Add
Procfileon the root1 2
release: npx prisma migrate deploy web: npm start
Push the changes to Heroku
1
$ git push heroku master
Add GitHub Deployment method
This configuration will deploy the heroku server automatically when the master branch of the project repository updated.
Go to
DeploytapSelect
GitHubon Deployment methodAdd App connected to GitHub and select project repository
Click
Enable Automatic Deployson Automatic deploys