# Quality gate. Vercel builds and deploys on its own; this workflow exists so a# broken dataset, a type error or a failing test is visible on the PR / commit# before (or regardless of) the deploy. Nothing here writes to the repo.name: CIon:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: readconcurrency:
group: ci-${{ github.ref }}cancel-in-progress: truejobs:
quality:
name: check · test · validate dataruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4 - uses: actions/setup-node@v4with:
node-version: 22cache: npm - run: npm ci - name: Typecheck (astro check)run: npm run check - name: Unit tests (node --test)run: npm test - name: Validate committed datasetrun: npm run validate:databuild:
name: astro build + pagefindruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4 - uses: actions/setup-node@v4with:
node-version: 22cache: npm - run: npm ci - run: npm run build - name: Sanity-check the outputrun: |
test -f dist/index.htmltest -f dist/catalog/index.htmltest -f dist/sitemap-index.xmltest -f dist/pagefind/pagefind.js# Canonicals must not point at a redirect (vercel.json: trailingSlash false).if grep -q 'rel="canonical" href="[^"]*/"' dist/catalog/index.html; thenecho "::error::canonical on /catalog carries a trailing slash"; exit 1; fi