chore: harden build and deployment workflow

This commit is contained in:
237899745
2026-07-27 13:07:14 +08:00
parent 6692736e88
commit f5377e51bb
10 changed files with 408 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
name: Backend tests
name: Build and tests
on:
push:
@@ -20,10 +20,23 @@ jobs:
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: backend/package-lock.json
cache-dependency-path: |
backend/package-lock.json
frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Audit production dependencies
run: npm audit --omit=dev
- name: Run backend tests
run: npm test
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Audit frontend dependencies
working-directory: frontend
run: npm audit
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Validate deployment script syntax
run: bash -n ../install.sh