-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (37 loc) · 1.15 KB
/
heroku-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Heroku Deploy
on:
push:
branches:
# for merged pull requests
- 'main'
# for hotfixes
- 'deploy'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# fetch complete commit history on all branches
fetch-depth: 0
- name: Set Heroku Credentials
run: |
cat > ~/.netrc <<EOF
machine api.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
- name: Add Heroku Remote
run: heroku git:remote -a ${{ secrets.HEROKU_APP_NAME }}
- name: Push to Heroku
# github.ref_name is the branch name that triggered the workflow
# you can assign any branch(es) you like in the on: block at the top of this yaml
# and the ref_name will pick them up
run: git push heroku ${{ github.ref_name }}:refs/heads/main