Created
January 29, 2020 06:45
-
-
Save andychongyz/8bd7a7f2db5e460d9f52be8789da689f to your computer and use it in GitHub Desktop.
github action - deploy master to heroku
This file contains hidden or 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
| 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