-
Notifications
You must be signed in to change notification settings - Fork 341
69 lines (66 loc) · 1.9 KB
/
preview.yaml
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
name: Surge PR Preview
on:
pull_request_target:
paths:
- 'web/**'
jobs:
verify:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./web
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 18
uses: actions/[email protected]
with:
node-version: 18
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install
run: npm ci --prefer-offline --no-audit
- name: Lint
run: |
npm run lint:ci
npm run typecheck
preview:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./web
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 18
uses: actions/[email protected]
with:
node-version: 18
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install
run: npm ci --prefer-offline --no-audit
- name: Prefetch
run: npm run prefetch
- name: Build 🏗️
env:
SENTRY_DSN: https://[email protected]/6588620
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
GIFT_APP_API_BASE: ${{ secrets.GIFT_APP_API_BASE }}
OSSINSIGHT_PREVIEW: true
TIDBCLOUD_HOST: staging.tidbcloud.com
run: npm run build
- name: Deploy to ossinsight.surge.sh 🚀
uses: afc163/surge-preview@v1
id: preview_step
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
teardown: true
build: echo 'Deployed to surge'
dist: './web/build'