-
Notifications
You must be signed in to change notification settings - Fork 93
46 lines (44 loc) · 1.38 KB
/
heroku-deploy.yml
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
38
39
40
41
42
43
44
45
46
name: Heroku Deploy
on:
push:
branches:
- 'staging'
- 'master'
- 'mocking'
jobs:
deploy:
name: Deploy Heroku
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# this means that it is a full history clone, not a shallow one
# heroku push fails with a shallow clone
fetch-depth: 0
- name: Set up git credentials
run: |
# doesn't matter the credentials here since we're not committing anything
# but git will complain if these are not set
git config --global user.email '[email protected]'
git config --global user.name 'MozMEAO Bot'
- name: Set up Heroku CLI
env:
API_KEY: ${{ secrets.HEROKU_API_KEY }}
EMAIL: '[email protected]'
run: |
cat > ~/.netrc <<EOF
machine api.heroku.com
login ${EMAIL}
password ${API_KEY}
machine git.heroku.com
login ${EMAIL}
password ${API_KEY}
EOF
- name: Deploy
run: |
set -ex
# the call to xargs here just strips whitespace
export APP_NAME="perfcompare-${GITHUB_REF_NAME}"
heroku git:remote --app "$APP_NAME"
git push --force heroku "${GITHUB_REF_NAME}:master"