This document summarizes the current GitHub Actions setup for sast-link-next.
| File | Purpose |
|---|---|
.github/workflows/ci.yml |
Main orchestrator for push / PR CI and deploy |
.github/workflows/quality.yml |
Lint, type-check, audit, dependency freshness |
.github/workflows/test.yml |
Jest coverage run, test/coverage artifact upload, Next.js build |
.github/workflows/deploy.yml |
Docker build, SCP transfer, and server deployment |
.github/workflows/release.yml |
Tag-triggered release pipeline that drafts a GitHub Release |
Runs on:
- push to
master - push to
develop - pull request targeting
master - pull request targeting
develop
Then calls:
quality.ymltest.ymldeploy.yml(only on push tomaster, after quality and test pass)
Runs on:
workflow_callworkflow_dispatch
Checks:
pnpm lint(blocking)pnpm exec tsc --noEmit(blocking)pnpm audit --audit-level=moderate(blocking)pnpm outdated(non-blocking)
Runs on:
workflow_callworkflow_dispatch
Main steps:
- setup pnpm + Node.js
pnpm install --frozen-lockfilepnpm test:coverage(coverage thresholds enforced via jest.config.ts)- upload
coverage/junit.xmlastest-results - upload
coverage/ascoverage-report - publish test results as PR comment
pnpm build- upload
out/asnextjs-build
Called by ci.yml on push to master. Builds the production Docker image, transfers it to the server, and executes the deployment with health-check verification and automatic rollback on failure.
Required secrets:
SERVER_HOSTSERVER_USERSSH_PRIVATE_KEY
Triggered when pushing tags matching v*.
Pipeline:
- run
quality.yml - run
test.yml - download artifacts
- create draft GitHub Release
- attach
nextjs-buildartifacts
Current build output flow:
pnpm buildusesnext.config.tswithoutput: "export"- static files are generated in
out/ - CI and release workflows both consume
out/artifacts
Current workflows use:
- pnpm cache via
actions/setup-node - test artifacts (
coverage/junit.xml,coverage/) - static build artifact (
out/)
- Jest coverage thresholds are enforced in
jest.config.ts(branches: 60%, functions: 60%, lines: 70%, statements: 70%) - Results are published as a step summary using
coverage-summary.json - JUnit XML via
jest-junitreporter for PR test result integration
| Secret | Used By |
|---|---|
SERVER_HOST |
deploy.yml |
SERVER_USER |
deploy.yml |
SSH_PRIVATE_KEY |
deploy.yml |
When editing CI behavior, keep these in sync:
.github/workflows/*.yml- this file (
CI_CD.md) - top-level docs (
README.md,README_zh.md,CONTRIBUTING.md)