Files
admin c01deca048
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
masterplan-lock / check (pull_request) Successful in 10s
CI (SIAX Cloud) / security (pull_request) Successful in 19s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 21s
CI (SIAX Cloud) / integration (pull_request) Successful in 40s
CI (SIAX Cloud) / quality (pull_request) Successful in 2m13s
ci: optimize delivery pipelines and add a production smoke gate
- One run per ref (concurrency) for CI, security, nightly and release; branch
  pushes no longer duplicate pull_request runs (push is main-only).
- Deploys keep their own concurrency group so two runs never race Coolify.
- pnpm store cache on every Node job.
- New /api/version returns the deployed commit (no secrets).
- New scheduled prod-smoke workflow: readiness, db/stripe health, running
  commit == main, and the document/credit routes exist (401/405, never 5xx).
2026-11-02 18:24:45 +01:00

25 lines
777 B
TypeScript

import { NextResponse } from 'next/server';
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
/**
* GET /api/version — deployment identity for automated verification.
*
* Returns only non-sensitive build identity (no env values, no config). The
* scheduled prod-smoke workflow compares `commit` with the current main SHA so
* "the container is up" is never confused with "the intended commit is live".
*/
export async function GET() {
const commit =
process.env.SOURCE_COMMIT ?? process.env.GIT_COMMIT_SHA ?? process.env.VERCEL_GIT_COMMIT_SHA ?? null;
return NextResponse.json(
{
service: '0pt-web',
commit,
built_at: process.env.BUILD_TIME ?? null,
},
{ headers: { 'cache-control': 'no-store' } },
);
}