-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (47 loc) · 1.67 KB
/
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
47
48
49
50
51
name: Deploy
env:
PORT: 5000
on:
push:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- run: npm ci
- run: npm run build --if-present
deploy:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: [email protected]
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Stage to PROD
if: endsWith(github.ref, '/master')
run: |
echo "HEROKU_APP_NAME=spark-matcher" >> $GITHUB_ENV
echo "TOKEN=${{secrets.TOKEN}}" >> $GITHUB_ENV
echo "MONGO_URL=${{secrets.MONGO_URL}}" >> $GITHUB_ENV
- name: Set env
run: echo ${{env.MONGO_URL }}
- run: heroku config:set PORT="${{env.PORT}}" -a ${{ env.HEROKU_APP_NAME }}
- run: heroku config:set MONGO_URL="${{secrets.MONGO_URL}}" -a ${{ env.HEROKU_APP_NAME }}
- run: heroku config:set PRIVATE_KEY="${{secrets.PRIVATE_KEY}}" -a ${{ env.HEROKU_APP_NAME }}
- run: heroku config:set CONTRACT_ADDRESS="${{secrets.CONTRACT_ADDRESS}}" -a ${{ env.HEROKU_APP_NAME }}
- run: heroku config:set NODE_URL="${{secrets.NODE_URL}}" -a ${{ env.HEROKU_APP_NAME }}
- name: Deploy to ${{ env.HEROKU_APP_NAME }}
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ env.HEROKU_APP_NAME }}
heroku_email: "[email protected]"
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git