-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (96 loc) · 3.46 KB
/
main.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: UI Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
setup:
name: Setup Node/NPM
runs-on: ubuntu-latest
steps:
- name: Stop previous
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
registry-url: 'https://npm.pkg.github.com'
scope: '@estuary'
- name: Get Deps
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
quality:
name: Check Quality
needs: setup
runs-on: ubuntu-latest
steps:
- name: Stop previous
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Get Deps
run: npm ci
- name: Licenses
run: npm run licenses
- name: Typecheck
run: npm run typecheck
- name: Linting
run: npm run lint
- name: Prettier
run: npm run format
- name: Test
run: npm run test
# Deployment steps undertaken on a merge to `main`.
deploy:
name: Deploy
env:
NODE_OPTIONS: '--max_old_space_size=4096'
needs: quality
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
# Ask github to inject an ID token with sufficient claims
# for GCP workload identity federation.
permissions:
contents: read
id-token: write
steps:
- name: Stop previous
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Get Deps
run: npm ci
- name: Create a release build
run: npm run build
# This was generated via `setup-workload-ident.sh` in the ops repo.
- name: Set up Google Cloud SDK
uses: google-github-actions/auth@v2
with:
service_account: [email protected]
workload_identity_provider: projects/1084703453822/locations/global/workloadIdentityPools/github-actions/providers/github-actions-provider
# Based on https://github.com/google-github-actions/example-workflows/blob/main/workflows/deploy-cloudrun/cloudrun-source.yml
- name: Update Dashboard Deployment
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: 'dashboard'
project_id: 'estuary-control'
region: 'us-central1'
source: './build/'