Skip to content

Instantly share code, notes, and snippets.

@noinarisak
Last active May 9, 2020 16:27
Show Gist options
  • Save noinarisak/6468e6fc4f69823cde8e4e80ad54d55c to your computer and use it in GitHub Desktop.
Save noinarisak/6468e6fc4f69823cde8e4e80ad54d55c to your computer and use it in GitHub Desktop.
# WIP
name: deploy-heroku
# Trigger only on v#.#.#-Release tag
on:
push:
tags:
- "v*.*.*-release"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
if: success() && contains(github.ref, 'tags')
- name: Push to Heroku
run: |
git push -f https://heroku:${{ secrets.HEROKU_API_TOKEN }}@git.heroku.com/${{ secrets.HEROKU_APP_PRODUCTION }}.git origin/master:master
- name: Update RELEASE_VERSION on Heroku production
if: success()
run: |
curl -n -X PATCH https://api.heroku.com/apps/${{ secrets.HEROKU_APP_PRODUCTION }}/config-vars \
-d '{
"RELEASE_VERSION”: "${{ github.ref }}",
}’ \
-H "Authorization: Bearer ${{ secrets.HEROKU_API_TOKEN }}"
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment