Skip to content

Deploying to Heroku

Levi edited this page Dec 28, 2021 · 8 revisions

Heroku

There are two methods available for deploying this bot to Heroku

Deploying with Workflow

  • Fork the repo
  • On the forked repo, go to Settings -> Secrets and click on the New repository secret button
  • Now enter the vars one by one with value
  1. HEROKU_API_KEY: Get the API Key from Heroku Account Settings
  2. HEROKU_EMAIL: Email address of your Heroku Account
  3. HEROKU_APP_NAME: Name of your Heroku App. It must be unique on Heroku.
  4. CONFIG_ENV_URL: Upload the config.env file on GitHub Gist. Now open the raw link of that gist and remove commit id from the link. Then fill the var with that link.
  • Then go to the Actions tab on your repo
  • Select Deploy to Heroku from the All workflow list
  • Click on Run workflow -> Run workflow
  • After that turn on the app dyno

Note: Don't change variables from Heroku. If you want to change any var, do it in config.env file on your gist, after that restart the app dyno.

Deploying with CLI

heroku login -i
  • Create a new app
heroku apps:create APPNAME
  • Connect the app to the repo
heroku git:remote -a APPNAME
  • Change stack of the app to container
heroku stack:set container -a APPNAME
  • Add the config files
git add -f .
  • Commit new changes
git commit -m "Added config"
  • Push the repo to heroku
git push heroku main --force
  • Now restart the app dyno
heroku ps:scale worker=0 -a APPNAME
heroku ps:scale worker=1 -a APPNAME

Note: Remember to replace APPNAME with your app's name.

Clone this wiki locally