-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.59 KB
/
Copy pathci-frontend.yml
File metadata and controls
59 lines (54 loc) · 1.59 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
# Frontend CI — install (frozen lockfile), lint (ESLint flat config), build.
# The committed pnpm-lock.yaml makes installs reproducible; the built SPA is
# uploaded as an artifact so a reviewer can download exactly what CI produced.
name: Frontend CI
on:
push:
branches: [master]
paths:
- 'frontend/**'
- '.github/workflows/ci-frontend.yml'
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/ci-frontend.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: frontend-ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: frontend
jobs:
build:
name: Lint & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
# action-setup runs from the repo root, where there is no package.json,
# so it can't read "packageManager" from frontend/package.json — pin the
# version explicitly (keep in sync with frontend/package.json).
uses: pnpm/action-setup@v4
with:
version: 9.12.0
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: ESLint
run: pnpm run lint
- name: Production build
run: pnpm run build
- name: Upload built SPA
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: frontend/dist
retention-days: 7