Created
November 3, 2020 12:32
-
-
Save samuelcolvin/88ea67df66d3a98f9d15fe4744dacfbe to your computer and use it in GitHub Desktop.
push to heroku to deploy when you create a release in github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:[email protected]/$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