ci: refresh workflow (re-run pipelines)

This commit is contained in:
ilia 2026-05-29 21:24:06 -05:00
parent 15860316cd
commit 7829a8af12

View File

@ -1,5 +1,5 @@
--- ---
# ci-sync: 2026-05-30T02:19:55Z # ci-sync: 2026-05-30T02:24:12Z
# Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02) # Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02)
name: CI name: CI
@ -37,12 +37,21 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: npm ci - name: Node / static site CI
run: | run: |
if [ -f package-lock.json ]; then npm ci; elif [ -f package.json ]; then npm install; else exit 0; fi set -e
if [ ! -f package.json ]; then
echo "No package.json — static/HTML repo; skip npm build pipeline"
if ls ./*.html >/dev/null 2>&1 || [ -f index.html ]; then
echo "Found HTML entrypoint(s) — OK for static site"
else
echo "No HTML files at repo root (advisory only)"
fi
exit 0
fi
if [ -f package-lock.json ]; then npm ci; else npm install; fi
- name: Playwright browsers
run: |
if [ -f playwright.config.ts ] || [ -f playwright.config.js ] || [ -f playwright.config.mjs ] \ if [ -f playwright.config.ts ] || [ -f playwright.config.js ] || [ -f playwright.config.mjs ] \
|| grep -q '@playwright/test' package.json 2>/dev/null; then || grep -q '@playwright/test' package.json 2>/dev/null; then
npx playwright install --with-deps chromium npx playwright install --with-deps chromium
@ -50,30 +59,21 @@ jobs:
echo "No Playwright — skip browser install" echo "No Playwright — skip browser install"
fi fi
- name: Lint npm run lint --if-present
run: npm run lint --if-present npm test --if-present
- name: Test
run: npm test --if-present
- name: Build
env:
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
export CI=true export CI=true
# Placeholders so Next.js/NextAuth can compile in CI without real secrets.
# Override via Gitea repo Actions secrets when you need production-like builds.
export NEXTAUTH_SECRET="${NEXTAUTH_SECRET:-ci-build-placeholder-not-for-production}" export NEXTAUTH_SECRET="${NEXTAUTH_SECRET:-ci-build-placeholder-not-for-production}"
export AUTH_SECRET="${AUTH_SECRET:-$NEXTAUTH_SECRET}" export AUTH_SECRET="${AUTH_SECRET:-$NEXTAUTH_SECRET}"
export NEXTAUTH_URL="${NEXTAUTH_URL:-http://localhost:3000}" export NEXTAUTH_URL="${NEXTAUTH_URL:-http://localhost:3000}"
export DATABASE_URL="${DATABASE_URL:-postgresql://ci:ci@127.0.0.1:5432/ci?schema=public}" export DATABASE_URL="${DATABASE_URL:-postgresql://ci:ci@127.0.0.1:5432/ci?schema=public}"
npm run build --if-present npm run build --if-present
npm audit --audit-level=high || true
- name: npm audit (advisory) env:
run: npm audit --audit-level=high || true NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
secret-scan: secret-scan:
needs: skip-ci-check needs: skip-ci-check