-
-
Notifications
You must be signed in to change notification settings - Fork 558
86 lines (73 loc) 路 2.3 KB
/
pull_request.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Compile, bundle, and upload application bundles
# to a cloud storage on each pull request to "main".
# https://help.github.com/actions
name: PR
on:
pull_request:
branches: [main]
env:
VERSION: ${{ github.event.pull_request.number }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp-key.json
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: ${{ env.PGUSER }}
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }}
POSTGRES_DB: ${{ env.PGDATABASE }}
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ github.workspace }}/.yarn/cache
${{ github.workspace }}/.yarn/unplugged
${{ github.workspace }}/.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
# Analyze code for potential problems
- run: yarn prettier --check .
- run: yarn lint --no-cache
# Test
- run: yarn api:tsc
- run: yarn db:migrate
- run: yarn test
# Compile
- run: yarn api:build
- run: yarn web:relay
- run: yarn web:build
# Upload to a cloud storage bucket
# - run: yarn workspaces foreach -p run push
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ github.workspace }}/.yarn/cache
${{ github.workspace }}/.yarn/unplugged
${{ github.workspace }}/.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install
# TODO: Deploy from the previously built artifacts
# - run: yarn workspaces foreach -p run deploy