2.9 KiB
Dedicated Gitea Runtime Builder Runner
Goal: build API/Worker runtime image tar on a machine that does not host production services.
Required machine
Minimum recommended spec:
- 2 vCPU minimum, 4 vCPU preferred.
- 4GiB RAM minimum, 8GiB preferred.
- 40GiB disk minimum.
- Docker Engine installed.
- Network access to Gitea and production SSH.
Do not install this runner on the current production host.
Runner label
The production runtime image workflow targets:
runs-on: runtime-builder
Register the new runner with a label named runtime-builder. Keep the existing production/staging runner separate.
Required Gitea secrets
The workflow can use either Gitea secrets or the dedicated runner-local upload key.
Preferred repository or organization secrets:
PRODUCTION_SSH_HOSTPRODUCTION_SSH_USERPRODUCTION_SSH_KEY
If these secrets are absent, the workflow falls back to:
- host:
47.98.113.167 - user:
root - key path on the dedicated builder:
/root/.ssh/xiaoxia_runtime_builder
The key must allow uploading to:
/var/lib/xiaoxia-saas-production/runtime-images-<tag>.tar
Do not store SSH private keys in the repository.
Workflow behavior
On v* tag push:
build-production-runtime-imagesruns onruntime-builder.- Checkout downloads the repository archive using the explicit
${{ github.token }}environment binding; runner shell environments must not assumeGITHUB_TOKENis implicitly set. - It executes
scripts/build_release_images.sh <tag>. - It builds
apps/web/distin a Node Docker container, not on production. - It packages
release-<tag>.tar.gzwith the prebuilt Web dist. - It uploads both
runtime-images-<tag>.tarandrelease-<tag>.tar.gzto production. deploy-productionruns after the build job succeeds, onruntime-builder, and drives production over SSH.deploy-productionextracts the prebuilt release artifact on production, loads/var/lib/xiaoxia-saas-production/runtime-images-<tag>.tar, and restarts API/Worker/Web.
If either the release tar or runtime image tar is missing, production deploy must fail. The production deploy job intentionally also runs on runtime-builder because Gitea needs scheduling previously skipped the downstream ubuntu-latest deploy job after a successful cross-runner build.
Preflight checks on runner
Run on the new runner before registration:
docker version
docker ps --format '{{.Names}}' | grep -Eq '^(xiaoxia-(api|web|worker|postgres|redis)-production|gitea)$' && exit 1 || true
The second command must not find production containers.
Validation release
After runner registration:
- Push a test tag only after
developis green. - Confirm runtime image build job runs on the dedicated runner.
- Confirm production deploy waits for the image job.
- Run:
python scripts/smoke_public_auth_flow.py
python scripts/smoke_public_upload_flow.py
- Record release result in the Phase progress document.