Skip to content

Instantly share code, notes, and snippets.

@andychongyz
Created January 29, 2020 06:45
Show Gist options
  • Select an option

  • Save andychongyz/8bd7a7f2db5e460d9f52be8789da689f to your computer and use it in GitHub Desktop.

Select an option

Save andychongyz/8bd7a7f2db5e460d9f52be8789da689f to your computer and use it in GitHub Desktop.
github action - deploy master to heroku
name: deployment
on: [push]
pull_request:
types: [closed]
branches:
- master
jobs:
main:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Deploy to staging
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
HEROKU_APP_NAME: "project-tapir"
if: github.ref == 'refs/heads/master' && job.status == 'success'
run: |
git filter-branch -- --all
git push https://heroku:[email protected]/$HEROKU_APP_NAME.git $(git rev-parse --abbrev-ref HEAD):master -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment