-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (60 loc) · 1.8 KB
/
ci-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
name: Build
on:
push:
branches:
- main
pull_request:
branches: [main, staging]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Use Yarn Cache
uses: actions/cache@v4
with:
path: ~/.cache/yarn
key: yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: yarn-
- name: Install
run: yarn
- name: Lint
run: yarn lint
- name: Type Check
run: yarn type-check
- name: Format
run: yarn format:check
- name: Configure environment for prod
run: echo "ENV=prod" >> $GITHUB_ENV
if: startsWith(github.base_ref, 'main')
- name: Configure environment for staging
run: echo "ENV=staging" >> $GITHUB_ENV
if: startsWith(github.base_ref, 'staging')
- name: Test
env:
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_PRIVATE_KEY_ID: ${{ secrets.FIREBASE_PRIVATE_KEY_ID }}
FIREBASE_DEV_PRIVATE_KEY: ${{ secrets.FIREBASE_DEV_PRIVATE_KEY}}
FIREBASE_DEV_PRIVATE_KEY_ID: ${{ secrets.FIREBASE_DEV_PRIVATE_KEY_ID }}
ENV: ${{ env.ENV }}
run: yarn test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Use Yarn Cache
uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: yarn-
- name: Install
run: yarn
- name: Build
run: yarn workspaces run build