CI: run tests and Renovate on the build VM
The test job and Renovate move to stpbuild's runner (label `build`), a new Proxmox VM; deploy and maintenance stay on stpvm (`self-hosted`). test fetches over HTTP with the job's own GITEA_TOKEN. DEPLOYMENT.md gains a "Build VM" section, and CLAUDE.md says where each job runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# `test` runs on every push; `deploy` runs for main only after it passes.
|
||||
# `test` runs on every push, on the build VM (stpbuild, label `build`);
|
||||
# `deploy` runs for main only after it passes, on stpvm (`self-hosted`),
|
||||
# since it recreates the stack there.
|
||||
# The runner is in host mode with only git and docker on the host, so Go and
|
||||
# Python run in containers pinned to the same images as their Dockerfiles
|
||||
# (bump together), and checkout is plain git rather than actions/checkout.
|
||||
@@ -11,13 +13,15 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: self-hosted
|
||||
runs-on: build
|
||||
env:
|
||||
# Via env so a branch name is never parsed as shell.
|
||||
SHA: ${{ github.sha }}
|
||||
REF: ${{ github.ref }}
|
||||
REMOTE: ssh://[email protected]:2222/adamf/stpweb.git
|
||||
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
|
||||
# Over HTTP with the job's own token (read access to this repo while
|
||||
# the job runs), so the runner needs no SSH key or Gitea user.
|
||||
REMOTE: http://git.adam-french.co.uk:3000/adamf/stpweb.git
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
# Kept between runs so fetches are incremental.
|
||||
CACHE: /home/adamf/.cache/stpweb-ci/repo.git
|
||||
SRC: /home/adamf/.cache/stpweb-ci/src-${{ github.sha }}
|
||||
@@ -30,7 +34,12 @@ jobs:
|
||||
[ -d "$CACHE" ] || git init --quiet --bare "$CACHE"
|
||||
# $SHA, not FETCH_HEAD: test this run's commit even if the
|
||||
# branch has moved on.
|
||||
git --git-dir="$CACHE" fetch --quiet --no-tags "$REMOTE" "$REF"
|
||||
# The job's token as a Basic auth header, passed via env rather
|
||||
# than -c so it never shows in the process list.
|
||||
auth=$(printf 'x-access-token:%s' "$GITEA_TOKEN" | base64 -w0)
|
||||
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader \
|
||||
GIT_CONFIG_VALUE_0="Authorization: Basic $auth" \
|
||||
git --git-dir="$CACHE" fetch --quiet --no-tags "$REMOTE" "$REF"
|
||||
rm -rf "$SRC"
|
||||
mkdir -p "$SRC"
|
||||
git --git-dir="$CACHE" archive --format=tar "$SHA" | tar -x -C "$SRC"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Weekly Renovate run (config in /renovate.json5). --network host uses the
|
||||
# Weekly Renovate run (config in /renovate.json5), on the build VM (stpbuild,
|
||||
# label `build`). --network host uses the
|
||||
# host's /etc/hosts pin to reach Gitea on the LAN, and RENOVATE_GIT_URL=endpoint
|
||||
# stops it cloning via the public ROOT_URL. Secrets are passed as bare `-e NAME`
|
||||
# so they never appear in the process list. Gitea refuses secret names starting
|
||||
@@ -13,7 +14,7 @@ on:
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: self-hosted
|
||||
runs-on: build
|
||||
steps:
|
||||
- name: Run Renovate
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user