Files
cameleer-website/.gitea/workflows/ci.yml
hsiegeln 93131461b8
Some checks failed
ci / build-test (push) Failing after 46s
Fix CI build: read PUBLIC_* values from secrets context, broaden TODO guard
- Switch ci.yml + deploy.yml env bindings from ${{ vars.* }} to
  ${{ secrets.* }}. Gitea lets you put non-sensitive Actions values in
  either tab, and the secrets tab was used in practice — workflow was
  reading the wrong context and getting empty strings.
- Broaden the "no TODO markers ship" guard to accept both TODO: and
  legacy TBD: prefixes, matching the imprint/privacy page markers that
  were recently renamed.
- Document the secret-vs-variable choice in OPERATOR-CHECKLIST so the
  next operator doesn't get tripped up by the same thing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 18:04:16 +02:00

100 lines
3.3 KiB
YAML

# -----------------------------------------------------------------------------
# cameleer-website — CI (build + test + lint + Lighthouse)
#
# Runs automatically on every push and every PR against main. Does NOT deploy —
# see deploy.yml for that. This workflow exists so every commit gets the full
# quality gate before it can reach production.
#
# Runner: self-hosted arm64 Gitea runner (act_runner).
# Adjust `runs-on` labels if your runner is registered under different tags.
# Architecture note: arm64 build, amd64 deploy is fine — Astro's output is
# plain static HTML/CSS/JS with no arch-specific bits.
# -----------------------------------------------------------------------------
name: ci
on:
push:
pull_request:
branches: [main]
jobs:
build-test:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
PUBLIC_AUTH_SIGNIN_URL: ${{ secrets.PUBLIC_AUTH_SIGNIN_URL }}
PUBLIC_AUTH_SIGNUP_URL: ${{ secrets.PUBLIC_AUTH_SIGNUP_URL }}
PUBLIC_SALES_EMAIL: ${{ secrets.PUBLIC_SALES_EMAIL }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
# Lighthouse CI needs a Chrome/Chromium binary at runtime. Google Chrome
# has no Linux/arm64 build, so install distro Chromium and export its
# path. Handles both `chromium` (Debian) and `chromium-browser` (older
# Ubuntu) package names, and works whether sudo is present or absent
# (e.g. runner running as root).
- name: Install Chromium for Lighthouse CI
shell: bash
run: |
set -e
if command -v sudo >/dev/null 2>&1; then SUDO=sudo; else SUDO=; fi
resolve_chromium() {
command -v chromium 2>/dev/null \
|| command -v chromium-browser 2>/dev/null \
|| true
}
CHROME_BIN="$(resolve_chromium)"
if [ -z "$CHROME_BIN" ]; then
$SUDO apt-get update -qq
$SUDO apt-get install -y --no-install-recommends \
chromium chromium-driver \
|| $SUDO apt-get install -y --no-install-recommends \
chromium-browser chromium-chromedriver
CHROME_BIN="$(resolve_chromium)"
fi
if [ -z "$CHROME_BIN" ]; then
echo "Failed to install a Chromium binary — Lighthouse CI cannot run."
exit 1
fi
echo "CHROME_PATH=$CHROME_BIN" >> "$GITHUB_ENV"
"$CHROME_BIN" --version || true
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test
- name: Build site
run: npm run build
- name: Guard — no TODO markers may ship in built HTML
run: |
if grep -rlE '(TODO|TBD):' dist 2>/dev/null | grep -E '\.(html|svg)$'; then
echo "Built output contains unfilled <TODO:...> (or legacy <TBD:...>) markers."
echo "Fill in imprint.astro and privacy.astro operator fields before merging to main."
exit 1
fi
- name: Validate HTML
run: npm run lint:html
- name: Check internal links
run: npm run lint:links
- name: Lighthouse CI
env:
CHROME_PATH: ${{ env.CHROME_PATH }}
run: npx lhci autorun