fix(docs): use pre-generated library.json — bib.sqlite corrupts during Docker COPY
Some checks failed
CI / lint (push) Successful in 45s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Successful in 1m56s
Deploy / api (push) Has been skipped
Deploy / mc (push) Has been skipped
Infra CI / notebooks (push) Failing after 20s
Infra CI / zotero (push) Successful in 18s
Infra CI / docs (push) Successful in 14s
Infra CI / api (push) Successful in 15s
Infra CI / mc (push) Successful in 16s
Deploy / report (push) Successful in 37s
CI / test (push) Has been cancelled
Some checks failed
CI / lint (push) Successful in 45s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Successful in 1m56s
Deploy / api (push) Has been skipped
Deploy / mc (push) Has been skipped
Infra CI / notebooks (push) Failing after 20s
Infra CI / zotero (push) Successful in 18s
Infra CI / docs (push) Successful in 14s
Infra CI / api (push) Successful in 15s
Infra CI / mc (push) Successful in 16s
Deploy / report (push) Successful in 37s
CI / test (push) Has been cancelled
This commit is contained in:
@@ -10,14 +10,12 @@ COPY docs/scripts/ docs/scripts/
|
||||
# Extract API docs via griffe (pure AST, no imports)
|
||||
RUN uv run --with griffe python docs/scripts/extract_docs.py
|
||||
|
||||
# Export bibliography. The COPY uses a multi-source form so the
|
||||
# bib.sqlite is optional — `data/.gitkeep` guarantees there's always
|
||||
# at least one matching source so BuildKit doesn't error on an empty
|
||||
# glob like `data/bib.sqlit[e]` did. The export script in turn
|
||||
# tolerates a missing bib.sqlite and writes an empty library.json.
|
||||
RUN mkdir -p data
|
||||
COPY data/.gitkeep data/bib.sqlit[e] data/
|
||||
RUN uv run --with pydantic python docs/scripts/export_library.py || (mkdir -p docs/static && echo '{"items":[]}' > docs/static/library.json)
|
||||
# Bibliography: library.json is pre-generated on the host via
|
||||
# uv run --with pydantic python docs/scripts/export_library.py
|
||||
# and lives in docs/static/library.json (gitignored, 193MB).
|
||||
# It's included in the build via COPY docs/static/ in stage 2.
|
||||
# We don't regenerate inside Docker because bib.sqlite is 234MB,
|
||||
# may be locked by the backfill, and corrupts on concurrent read.
|
||||
|
||||
|
||||
# Stage 2: Build Docusaurus static site
|
||||
@@ -37,10 +35,9 @@ COPY docs/src/ src/
|
||||
COPY docs/static/ static/
|
||||
COPY docs/docs/ docs/
|
||||
|
||||
# Copy generated API docs and library.json from extract stage
|
||||
# Copy generated API docs from extract stage
|
||||
COPY --from=extract /build/docs/docs/api/ docs/api/
|
||||
COPY docs/docs/api/index.md docs/api/index.md
|
||||
COPY --from=extract /build/docs/static/library.json static/library.json
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user