-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (89 loc) · 3.37 KB
/
Copy pathci.yml
File metadata and controls
99 lines (89 loc) · 3.37 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Actions are pinned to commit SHAs, not floating major tags. `@v4` is a moving
# reference the upstream owner can repoint at any commit, which is the
# supply-chain shape that has repeatedly bitten CI ecosystems — and these
# workflows can read the repository and, at release, push an image.
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
- name: Install pnpm
run: npm install -g pnpm@10
- name: Ship lint + tests
run: |
pnpm install --frozen-lockfile
pnpm --dir web install --frozen-lockfile
pnpm run lint
pnpm test
# The web app has its own typecheck and tests (session policy, webhook
# body caps, rate limiting) that the ship package's suite never touches.
- name: Web typecheck + tests
run: |
cd web
pnpm install --frozen-lockfile
npx tsc --noEmit
pnpm test
- name: Web production build
run: |
cd web
pnpm run build
# A committed credential is the one mistake that cannot be walked back once
# it reaches the public mirror.
secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
- run: node scripts/scan-secrets.mjs
# A vulnerable production dependency is a vulnerable dependency in the image;
# knowing at PR time rather than at tag time is the whole point.
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
- run: npm install -g pnpm@10
- run: pnpm install --frozen-lockfile
- name: Audit production dependencies
run: |
pnpm audit --prod --audit-level high
pnpm --dir web install --frozen-lockfile
pnpm --dir web audit --audit-level high
node scripts/audit-deployment.mjs
# The image is what actually ships. Building it here turns a Dockerfile
# mistake into a failed PR instead of a failed release.
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
- run: npm install -g pnpm@10
- name: Build the artifacts the image copies
run: |
pnpm install --frozen-lockfile
pnpm run build
cd web && pnpm install --frozen-lockfile && pnpm run build
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: .
push: false
load: true
tags: teploy-ship:ci
- name: Smoke the image through its published port
run: bash scripts/smoke-image.sh teploy-ship:ci