ci: cap build to 2 of 4 cores so the Pi5 stays responsive

The self-hosted runner builds on the Pi5 alongside live services; the
unthrottled build saturated all cores (Go compiler + esbuild) and took the
reverse-proxied sites down. Add BUILD_CPUS build-arg → GOMAXPROCS in both
build stages (caps the Go compiler and Vite's esbuild) and go build -p,
plus nice/ionice on the build. Slower build, responsive host.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-05 22:35:39 +02:00
parent cd588197b9
commit 95e0d8fce1
2 changed files with 20 additions and 3 deletions

View File

@@ -25,8 +25,13 @@ jobs:
uses: actions/checkout@v4
- name: Build & push image
# The runner builds on the Pi5 next to live services. BUILD_CPUS caps the
# CPU-heavy build tools (Go compiler + esbuild) to 2 of 4 cores so the box
# stays responsive; nice/ionice further deprioritise the client-side work.
# Slower build, but nginx/NPM and the other containers keep serving.
run: |
docker build --progress=plain \
nice -n 19 ionice -c 3 docker build --progress=plain \
--build-arg BUILD_CPUS=2 \
-f docker/Dockerfile \
-t localhost:5000/archivum:latest \
-t "localhost:5000/archivum:${GITHUB_SHA::12}" \