Skip to content

Latest commit

 

History

History
95 lines (66 loc) · 3.22 KB

deployment.md

File metadata and controls

95 lines (66 loc) · 3.22 KB

Deployment

This project is set up to deploy to Heroku, using the Container stack.

Prerequisites

Read the README

The [prerequisites to deploy to Heorku][prerequisites] is the same as the local development environment.

You'll also need to [setup up the .env file][dotenv] in your project directory.

Setup

  1. Sign up for a Heroku account if you don't already have one.

  2. Install the Heroku CLI. On macOS:

    brew tap heroku/brew && brew install heroku
  3. Set up an app in the main project dir:

    npm run heroku:setup

    You may be asked to login so the Heroku CLI can perform tasks in your account.

    At the end of the process (which will take about 5 minutes), you'll be shown the details of your app, including the URL of where you can access the app.

    You should see the app running in your browser. If not, just visit the URL.

Deployment

As you make code changes to the server or the app, you can always deploy your current working branch to see it running at Heroku:

npm run heroku:deploy

Automatic Deployment

This repo also contains a GitHub Actions deployment workflow. Any new commits to the main branch will trigger the workflow.

⚠️ IMPORTANT: You still need to run the Heroku setup step before you can automatically deploy.

  1. Create a Heroku API token:

    heroku authorizations:create -d "GitHub Actions"

    Copy the "Token" value.

  2. Add the following GitHub repository secrets:

    • HEROKU_API_KEY: the Heorku authorization token
    • HEROKU_APP_NAME: the Heroku app name (heroku apps if you forgot it)

From now on, whenever you push or merge into the main branch, GitHub will automatically deploy the branch to Heroku! 🙌

Tips

Task Command
Access your app heroku open
See the running app log heroku logs -t
See details about your app heroku apps:info
Rename your app heroku apps:rename <NEWNAME>
Access the app dashboard npm run heroku:dashboard
Access the Heroku PostgreSQL instance npm run heroku:psql
See the database connection string heroku config:get DATABASE_URL
Access the database dashboard heroku addons:open DATABASE

Additional Information