ilia 79eb3e2779
Some checks failed
CI / skip-ci-check (pull_request) Successful in 9s
CI / secret-scan (pull_request) Successful in 8s
CI / node-ci (pull_request) Failing after 28s
ci: sync workflow template
2026-05-29 20:26:14 -05:00

76 lines
2.1 KiB
YAML

---
# Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02)
name: CI
on:
push:
branches: [master, main]
pull_request:
types: [opened, synchronize, reopened]
jobs:
skip-ci-check:
runs-on: [homelab, self-hosted, linux]
container:
image: node:20-bookworm
outputs:
should-skip: ${{ steps.check.outputs.skip }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- id: check
run: |
SKIP=0
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
MSG="${GITHUB_EVENT_HEAD_COMMIT_MESSAGE:-$(git log -1 --pretty=%B 2>/dev/null || true)}"
echo "$BRANCH" "$MSG" | grep -qi '@skipci' && SKIP=1
echo "skip=$SKIP" >> $GITHUB_OUTPUT
node-ci:
needs: skip-ci-check
if: needs.skip-ci-check.outputs.should-skip != '1'
runs-on: [homelab, self-hosted, linux, node]
container:
image: node:20-bookworm
steps:
- uses: actions/checkout@v4
- name: npm ci
run: |
if [ -f package-lock.json ]; then npm ci; elif [ -f package.json ]; then npm install; else exit 0; fi
- name: Playwright browsers
run: |
if [ -f playwright.config.ts ] || [ -f playwright.config.js ] || [ -f playwright.config.mjs ] \
|| grep -q '@playwright/test' package.json 2>/dev/null; then
npx playwright install --with-deps chromium
else
echo "No Playwright — skip browser install"
fi
- name: Lint
run: npm run lint --if-present
- name: Test
run: npm test --if-present
- name: Build
run: npm run build --if-present
- name: npm audit (advisory)
run: npm audit --audit-level=high || true
secret-scan:
needs: skip-ci-check
if: needs.skip-ci-check.outputs.should-skip != '1'
runs-on: [homelab, self-hosted, linux, heavy]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Gitleaks
run: |
docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:latest \
detect --source /repo --no-banner --redact