Skip to content

Newbie review v2: Quickstart bridges + expanded acronym table #93

Newbie review v2: Quickstart bridges + expanded acronym table

Newbie review v2: Quickstart bridges + expanded acronym table #93

Workflow file for this run

name: Build
on:
pull_request:
branches: [main, dev]
push:
branches: [main, dev]
workflow_dispatch:
# Cancel in-progress runs for the same branch / PR when a new push arrives
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate schema
# The `|| echo` fallback already prevents missing-ajv-cli from failing
# the step, so continue-on-error isn't needed here.
run: npx ajv compile -s schema/ads.schema.json --spec=draft2020 --strict=false || echo "ajv-cli not present; skipping schema validation"
- name: Run project validate
# Fails the build on hard errors (missing required files, deprecated
# terms, broken JSON template, missing required translations, etc.).
# Warnings still surface in the log but don't fail the build.
run: npm run validate
- name: Build site
run: npm run build
- name: Check build output exists
run: |
test -d dist/v1 || (echo "Build output dist/v1 missing"; exit 1)
test -f dist/index.html || (echo "Root index.html missing"; exit 1)
- name: Upload build artefact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: dist-${{ github.event.pull_request.number || github.sha }}
path: dist
retention-days: 7
# Notes on action versions:
# - actions/checkout@v5 and actions/setup-node@v5 use Node.js 24, addressing
# the September 2025 Node 20 deprecation warning.
# - actions/upload-artifact remains on v4 (the current major; v5 isn't out as
# of this write). It runs on Node 20 internally — when v5 ships supporting
# Node 24, bump it. Until then, the deprecation warning for upload-artifact
# is informational, not a build failure.
# - We build with Node.js 22 (active LTS) — newer than 20, with broader
# ecosystem support than 24. Bump to 24 when it goes LTS (Oct 2026).