Skip to content

Instantly share code, notes, and snippets.

@samuelcolvin
Created November 3, 2020 12:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelcolvin/88ea67df66d3a98f9d15fe4744dacfbe to your computer and use it in GitHub Desktop.
Save samuelcolvin/88ea67df66d3a98f9d15fe4744dacfbe to your computer and use it in GitHub Desktop.
push to heroku to deploy when you create a release in github
deploy:
needs:
- test
- lint
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP: <heroku app name>
steps:
- uses: actions/checkout@v2
- run: sudo timedatectl set-timezone 'Europe/London' # or your timezone
- run: git fetch --unshallow
- run: git switch master
- run: git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP.git
- run: git push heroku master
- run: heroku config:set -a $HEROKU_APP RELEASE=`python -c "print('$GITHUB_REF'.split('/')[2])"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment