mirror of
https://github.com/netbirdio/docs.git
synced 2026-09-17 12:29:05 +02:00
perf: build docs on the CI runner with a warm .next cache (#840)
Move `npm run build` out of the Docker image onto the runner, where actions/cache persists .next/cache across runs (the in-Docker build discarded it every time). The image now just packages the prebuilt .next and serves it with `next start`; runtime and the DocSearch entrypoint injection are unchanged. Also: checkout full history (fetch-depth: 0) so per-page dates are correct, guard buildGitDateMap against shallow clones (correct-or-absent, never wrong), modernise the Docker actions (build-push-action v6, provenance: false), and add a path-filtered pull_request trigger so pipeline changes are validated before merge. Smoke-tested via isolated build + docker run: serves /, /introduction, /api, sitemap, static assets (200); DocSearch placeholder injection intact.
This commit is contained in:
+8
-3
@@ -1,10 +1,15 @@
|
||||
.git/
|
||||
.gitignore
|
||||
.next/ # Existing Next.js builds
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
node_modules/ # Installed inside container
|
||||
LICENSE
|
||||
README.md
|
||||
AUTHORS
|
||||
AUTHORS
|
||||
|
||||
# Reinstalled inside the image (alpine-native — avoids a glibc/musl mismatch)
|
||||
node_modules/
|
||||
|
||||
# The built .next output is copied in (built on the CI runner, see
|
||||
# build_n_push.yml); only the build cache is excluded — it is not served.
|
||||
.next/cache/
|
||||
|
||||
Reference in New Issue
Block a user