-
Notifications
You must be signed in to change notification settings - Fork 32
86 lines (81 loc) · 2.31 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
jobs:
deploy_staging:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
env:
MPKIT_URL: ${{ secrets.MPKIT_URL_STAGING }}
MPKIT_EMAIL: ${{ secrets.MPKIT_EMAIL }}
MPKIT_TOKEN: ${{ secrets.MPKIT_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install npm dependencies
run: npm ci
- name: Build assets
run: npm run build
- name: Build graphql docs
run: npm run build:graphql
- name: Deploy to staging
run: npx @platformos/pos-cli deploy
test_staging:
needs: deploy_staging
runs-on: ubuntu-latest
strategy:
max-parallel: 1
env:
MPKIT_URL: ${{ secrets.MPKIT_URL_STAGING }}
steps:
- uses: actions/checkout@v1
- name: Install test framework
run: npm i codeceptjs @codeceptjs/configure puppeteer
- run: npm test
deploy_production:
needs: test_staging
runs-on: ubuntu-latest
strategy:
max-parallel: 1
env:
MPKIT_URL: ${{ secrets.MPKIT_URL_PRODUCTION }}
MPKIT_EMAIL: ${{ secrets.MPKIT_EMAIL }}
MPKIT_TOKEN: ${{ secrets.MPKIT_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install npm dependencies
run: npm ci
- name: Build assets
run: npm run build
- name: Build graphql docs
run: npm run build:graphql
- name: Deploy production
run: npx @platformos/pos-cli deploy
- name: Warm cache
run: time curl $MPKIT_URL >> /dev/null
- run: time curl $MPKIT_URL >> /dev/null
- run: time curl $MPKIT_URL >> /dev/null
- run: time curl $MPKIT_URL >> /dev/null
- run: time curl $MPKIT_URL >> /dev/null
# lighthouse_ci:
# needs: deploy_production
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 1
# env:
# MPKIT_URL: ${{ secrets.MPKIT_URL_PRODUCTION }}
# LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: '14.x'
# - run: npm i -g @lhci/cli
# - run: lhci autorun