Workflow
scripts/build-search-index.tsscans docs plus JSON content datasets underassets/content/<locale>/pokemon/andassets/content/<locale>/moves/.- It writes:
build/search-index.jsonfor local merged search fallbackbuild/search-indices.jsonfor remote multi-index syncingbuild/content/en/pokemon-manifest.jsonandbuild/content/es/pokemon-manifest.jsonfor fast frontend Pokemon list/navigationbuild/content/en/moves-manifest.jsonandbuild/content/es/moves-manifest.jsonfor fast frontend move list/navigationbuild/content/en/move-learners-manifest.jsonandbuild/content/es/move-learners-manifest.jsonfor fast move detail learner lookups
- If
MEILISEARCH_URLandMEILISEARCH_KEYare set, the script pushes each index payload (wiki-docs,wiki-pokemon, andwiki-moves) directly to the corresponding Meilisearch index. .github/workflows/search-index.ymlruns the script onmainand nightly, uploads the generated search payloads plus frontend content manifests as workflow artifacts, then sends the multi-index JSON payload to the website backend's protected sync endpoint so Meilisearch can stay private.
Required Settings
| Variable | Description |
|---|---|
MEILISEARCH_URL | Base URL of the self-hosted Meilisearch instance |
MEILISEARCH_KEY | Admin or documents key with write access |
Optional CI Settings
| Secret | Description |
|---|---|
WIKI_SEARCH_SYNC_URL | Optional public HTTPS URL of the backend sync endpoint |
WIKI_SEARCH_SYNC_TOKEN | Optional shared bearer token validated by the backend before importing documents |
When both secrets are configured, the workflow syncs
build/search-indices.json to the website backend. When either secret is missing,
the workflow still builds the search payloads and uploads the generated artifacts
so the run stays debuggable.
Local Run
MEILISEARCH_URL=https://search.pokebedrock.com \
MEILISEARCH_KEY=<docs-key> \
npm run build:search
The command writes the search payloads plus frontend manifests, and pushes the three remote indices when env vars are set.
Production Sync Endpoint
The default production flow does not expose Meilisearch publicly:
- GitHub Actions builds
build/search-index.json,build/search-indices.json, and the frontend content manifests underbuild/content/<locale>/(pokemon-manifest.json,moves-manifest.json,move-learners-manifest.json). All of these are uploaded as workflow artifacts. - If
WIKI_SEARCH_SYNC_URLandWIKI_SEARCH_SYNC_TOKENare configured, the workflowPOSTsbuild/search-indices.jsonto the website backend. - When those secrets are not configured yet, the workflow skips the backend sync step and still uploads the generated artifacts.
- If sync runs, the backend validates
WIKI_SEARCH_SYNC_TOKEN. - The backend then connects to
http://meilisearch:7700inside the cluster and replaces:wiki-docswiki-pokemonwiki-moves
Document Schema
{
"id": "guides/getting-started",
"slug": "guides/getting-started",
"title": "Getting Started",
"description": "Short summary…",
"tags": ["guide", "onboarding"],
"lastUpdated": "2025-11-21",
"status": "stable",
"lang": "en",
"order": 3,
"body": "Markdown content without frontmatter"
}
Keep descriptions ≤ 180 characters to avoid truncation in search UIs.