Skip to content

Instantly share code, notes, and snippets.

@sleeptil3
Last active July 30, 2021 04:33
Show Gist options
  • Save sleeptil3/332c356b7b864b91a760dce616359749 to your computer and use it in GitHub Desktop.
Save sleeptil3/332c356b7b864b91a760dce616359749 to your computer and use it in GitHub Desktop.
Heroku CLI Deploy using GitHub
##################################################################
# #
# README: #
# #
# This assumes that you have not yet created the app on Heroku, #
# your publish-ready project is git initialized and committed, #
# and you are in the base directory of the project. #
# #
##################################################################
# Install Heroku CLI (macOS)
$ brew tap heroku/brew && brew install heroku
# Install Heroku CLI (windows)
# Download the installer from devcenter.heroku.com
# Create the new app on Heroku
$ heroku create <app name>
# Add Config Vars, if any (environment variables)
# You must use quotes for string values with non-alphaNum chars like URLs
$ heroku config:set ENV_VAR_NAME=value
# Publish Code to Heroku
$ git push heroku main
#########################
# Other Useful Commands #
#########################
# Verify Git Remote Location Creation
# you should see entries for 'heroku' and 'origin' if you have a GitHub remote
$ git remote -v
# Rename a Heroku app
$ heroku rename <newname>
# Remove a config var
$ heroku config:unset <ENV_VAR_NAME>
# View current config var values
$ heroku config:get <ENV_VAR_NAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment