-
Notifications
You must be signed in to change notification settings - Fork 256
65 lines (50 loc) · 2.02 KB
/
lint.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
name: Build and Deploy
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check lockfileVersion for root
run: |
test -f package-lock.json
test "$(jq '.lockfileVersion' package-lock.json)" -eq 2
- name: Check lockfileVersion for frontend
run: |
test -f frontend/package-lock.json
test "$(jq '.lockfileVersion' frontend/package-lock.json)" -eq 2
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: "16.14.0"
- run: npm ci
- run: npm run lint
- run: npm run validate-migrations
- name: Setup frontend for testnet
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/testnet' }}
run: node scripts/ci-setup-frontend-for-testnet.js
- name: Setup frontend for mainnet
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/production' }}
run: node scripts/ci-setup-frontend-for-mainnet.js
- name: Build smart contracts
run: npm run contract:prepare
- run: npm run build:frontend
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Deploy testnet frontend
uses: netlify/actions/cli@375963b92b795c7b979927c580dd6f2a65ebcf28
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/testnet' }}
with:
args: deploy --dir=frontend/dist --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_TESTNET_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
- name: Deploy mainnet frontend
uses: netlify/actions/cli@375963b92b795c7b979927c580dd6f2a65ebcf28
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/production' }}
with:
args: deploy --dir=frontend/dist --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_MAINNET_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}