Skip to content

Bump API schema to 95882227 (#18951) #6324

Bump API schema to 95882227 (#18951)

Bump API schema to 95882227 (#18951) #6324

Workflow file for this run

name: Update Algolia index
on:
push:
branches:
- master
# Smoke-test the indexing path on PRs that touch the indexing machinery, so runner/dependency
# regressions (e.g. the Bun->tsx swap that broke module resolution) are caught before merge
# instead of only surfacing on master. Pure docs-content PRs don't change this machinery and
# are validated by the normal build, so they're intentionally excluded to keep CI lean.
pull_request:
paths:
- '.github/workflows/algolia-index.yml'
- 'scripts/algolia.ts'
- 'scripts/tsconfig.json'
- 'src/mdx.ts'
- 'package.json'
- 'pnpm-lock.yaml'
jobs:
index:
name: Update Algolia index
runs-on: ubuntu-latest
# Only push events have access to the Algolia secrets and should mutate the live index.
if: github.event_name == 'push'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@02f6c237bd2518259fed6c71566509edfb3f2b74 # v4
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
id: setup-node
with:
node-version-file: 'package.json'
cache: 'pnpm'
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
docs:
- 'docs/**'
- 'includes/**'
- 'platform-includes/**'
dev-docs:
- 'develop-docs/**'
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
${{ github.workspace }}/.next/cache
key: nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-
- run: pnpm install --frozen-lockfile
# NODE_OPTIONS is scoped to the indexing script, NOT the job: setting it job-wide (as #17283
# did) let `next build` claim more heap than the runner has and got the whole runner
# OOM-killed. The script itself batches its uploads, so this is headroom, not a requirement.
- name: Build index for user docs
run: pnpm enforce-redirects && pnpm generate-doctree && pnpm next build && NODE_OPTIONS=--max-old-space-size=8192 npx tsx --tsconfig ./scripts/tsconfig.json ./scripts/algolia.ts
if: steps.filter.outputs.docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
DOCS_INDEX_NAME: ${{ secrets.DOCS_INDEX_NAME }}
ALGOLIA_SENTRY_DSN: ${{ secrets.ALGOLIA_SENTRY_DSN }}
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
- name: Build index for developer docs
run: git submodule init && git submodule update && pnpm enforce-redirects && pnpm generate-doctree && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm next build && npx tsx --tsconfig ./scripts/tsconfig.json ./scripts/algolia.ts
if: steps.filter.outputs.dev-docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
DOCS_INDEX_NAME: ${{ secrets.DEVELOP_DOCS_INDEX_NAME }}
ALGOLIA_SENTRY_DSN: ${{ secrets.ALGOLIA_SENTRY_DSN }}
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_DEVELOPER_DOCS: 1
smoke-test:
name: Smoke-test Algolia indexing (dry run)
runs-on: ubuntu-latest
# PRs run the indexing script in dry-run mode (no secrets, no upload) purely to verify the
# script and its full import graph resolve under the configured runner -- the regression class
# that the Bun->tsx swap introduced, which happens at module load. This deliberately skips
# `next build`: building the ~10k-page site takes minutes and only validates build output,
# which Vercel's PR preview deploy already covers. With no build there are no .next HTML files,
# so ALGOLIA_SKIP_ON_ERROR lets the script tolerate the missing pages and finish in seconds.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@02f6c237bd2518259fed6c71566509edfb3f2b74 # v4
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
id: setup-node
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Dry-run index for user docs
run: npx tsx --tsconfig ./scripts/tsconfig.json ./scripts/algolia.ts
env:
ALGOLIA_DRY_RUN: 'true'
ALGOLIA_SKIP_ON_ERROR: 'true'
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0