-
Notifications
You must be signed in to change notification settings - Fork 57
91 lines (77 loc) · 2.42 KB
/
deploy-master.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Master deployment
on:
push:
branches:
- master
env:
EXCHANGE_WALLET_PUB: ${{secrets.EXCHANGE_WALLET_PUB}}
GOOGLE_MAPS_API_KEY: ${{secrets.GOOGLE_MAPS_API_KEY}}
SINGLE_ACCOUNT_MODE: ${{secrets.SINGLE_ACCOUNT_MODE}}
ISSUER_ID: ${{secrets.ISSUER_ID}}
SMART_METER_ID: ${{secrets.SMART_METER_ID}}
REGISTRATION_MESSAGE_TO_SIGN: ${{secrets.REGISTRATION_MESSAGE_TO_SIGN}}
jobs:
cancel-previous:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
deploy-application:
services:
postgres:
image: postgres
env:
POSTGRES_DB: 'origin'
POSTGRES_PASSWORD: 'postgres'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 10s
--health-retries 10
ports:
- 5432:5432
runs-on: ubuntu-latest
needs: cancel-previous
steps:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: "Generate unique id"
id: generate_unique_id
uses: ./.github/actions/build_id
- name: Restore timestamp
run: |
sh scripts/restore-original-timestamps.sh
- name: Install rush
run: |
npm install -g @microsoft/rush
- name: Install application
# lerna doesn't work without additional fetch
run: |
node common/scripts/install-run-rush.js update
- name: Build application
run: |
node common/scripts/install-run-rush.js rebuild -v
- name: Build UI for production
run: |
node common/scripts/install-run-rush.js build:ui:prod
- name: Build Storybook application
run: node common/scripts/install-run-rush.js build:storybook
- name: Deploy application
run: |
yarn build:containers:canary
yarn deploy:heroku:canary
env:
BUILD_ID: ${{ steps.generate_unique_id.outputs.unique_id }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_CANARY_APP_API: ${{ secrets.HEROKU_CANARY_APP_API }}
HEROKU_CANARY_APP_UI: ${{ secrets.HEROKU_CANARY_APP_UI }}
HEROKU_CANARY_APP_SB: ${{ secrets.HEROKU_CANARY_APP_SB }}