From b9d298844ae24d1a1cb2d67d40e2582d6ea20386 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 16:19:19 -0500 Subject: [PATCH 1/6] ci: add homelab Gitea Actions workflow (ci-node.yml) --- .gitea/workflows/ci.yml | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..f53f526 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,64 @@ +--- +# 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] + 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: 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 From 2b5d47863ec3abd0e8749b4ced71fa1d3a465bb1 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 20:14:59 -0500 Subject: [PATCH 2/6] ci: sync workflow template (node container + host fixes) --- .gitea/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f53f526..cf36397 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -11,6 +11,8 @@ on: jobs: skip-ci-check: runs-on: [homelab, self-hosted, linux] + container: + image: node:20-bookworm outputs: should-skip: ${{ steps.check.outputs.skip }} steps: From a6a0abc729dde7543f49986d8ef28114def5d0c7 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 20:20:38 -0500 Subject: [PATCH 3/6] ci: refresh workflow (re-run pipelines) --- .gitea/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cf36397..f361572 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,4 +1,5 @@ --- +# ci-sync: 2026-05-30T01:20:44Z # Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02) name: CI From a20e3e7e3c1d611013a517b8feb95104957e1f53 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 20:26:10 -0500 Subject: [PATCH 4/6] ci: sync workflow template --- .gitea/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f361572..4793707 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,5 +1,4 @@ --- -# ci-sync: 2026-05-30T01:20:44Z # Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02) name: CI @@ -41,6 +40,15 @@ jobs: 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 From a882737f8433d46420d6b174754d8e4ef5875f38 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 20:28:28 -0500 Subject: [PATCH 5/6] ci: refresh workflow (re-run pipelines) --- .gitea/workflows/ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4793707..c5a051e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,4 +1,5 @@ --- +# ci-sync: 2026-05-30T01:28:34Z # Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02) name: CI @@ -56,7 +57,20 @@ jobs: run: npm test --if-present - name: Build - run: npm run build --if-present + 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 + # 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 AUTH_SECRET="${AUTH_SECRET:-$NEXTAUTH_SECRET}" + export NEXTAUTH_URL="${NEXTAUTH_URL:-http://localhost:3000}" + export DATABASE_URL="${DATABASE_URL:-postgresql://ci:ci@127.0.0.1:5432/ci?schema=public}" + npm run build --if-present - name: npm audit (advisory) run: npm audit --audit-level=high || true From 4dc71b63b07547a817129dd473b2d7d7fce595e8 Mon Sep 17 00:00:00 2001 From: ilia Date: Fri, 29 May 2026 20:30:52 -0500 Subject: [PATCH 6/6] ci: refresh workflow (re-run pipelines) --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c5a051e..b1803b2 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,5 +1,5 @@ --- -# ci-sync: 2026-05-30T01:28:34Z +# ci-sync: 2026-05-30T01:30:58Z # Homelab CI — Node/pages lane (git-ci-01) + secret scan (git-ci-02) name: CI