Rename the repo to adamf/stpweb
Test and deploy / test (push) Successful in 1m29s
Test and deploy / deploy (push) Successful in 2s

Point CI, Renovate, the CV links, tests and docs at adamf/stpweb and
the deploy folder at ~/deploy/stpweb. Pin the Compose project name to
web_server so the existing volumes and network keep their names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 20:54:30 +00:00
co-authored by Claude Opus 5.5
parent 4530cb8dc4
commit bfe2fe2782
13 changed files with 38 additions and 35 deletions
+10 -10
View File
@@ -16,11 +16,11 @@ jobs:
# Via env so a branch name is never parsed as shell.
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
REMOTE: ssh://[email protected]:2222/adamf/web_server.git
REMOTE: ssh://[email protected]:2222/adamf/stpweb.git
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
# Kept between runs so fetches are incremental.
CACHE: /home/adamf/.cache/web_server-ci/repo.git
SRC: /home/adamf/.cache/web_server-ci/src-${{ github.sha }}
CACHE: /home/adamf/.cache/stpweb-ci/repo.git
SRC: /home/adamf/.cache/stpweb-ci/src-${{ github.sha }}
steps:
- name: Export the pushed commit to a scratch directory
shell: bash
@@ -48,8 +48,8 @@ jobs:
docker run --rm \
-v "$SRC":/src:ro \
-w /src/backend \
-v web_server_ci_gomod:/go/pkg/mod \
-v web_server_ci_gobuild:/root/.cache/go-build \
-v stpweb_ci_gomod:/go/pkg/mod \
-v stpweb_ci_gobuild:/root/.cache/go-build \
golang:1.26 \
sh -c 'go vet ./... && go test ./...'
@@ -61,7 +61,7 @@ jobs:
docker run --rm \
-v "$SRC":/src:ro \
-w /src/python \
-v web_server_ci_pip:/root/.cache/pip \
-v stpweb_ci_pip:/root/.cache/pip \
-e PYTHONDONTWRITEBYTECODE=1 \
python:3.12-slim \
sh -c 'pip install --quiet --disable-pip-version-check --root-user-action=ignore -r requirements-dev.txt && python -m pytest tests -q -p no:cacheprovider'
@@ -77,15 +77,15 @@ jobs:
runs-on: self-hosted
steps:
- name: Pull changes
working-directory: /home/adamf/deploy/web_server
working-directory: /home/adamf/deploy/stpweb
env:
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
SHA: ${{ github.sha }}
shell: bash
run: |
set -eu
git config --global --add safe.directory /home/adamf/deploy/web_server
git fetch ssh://[email protected]:2222/adamf/web_server.git main
git config --global --add safe.directory /home/adamf/deploy/stpweb
git fetch ssh://[email protected]:2222/adamf/stpweb.git main
# Deploy only the tested commit; a newer main gets its own
# run. This also stops a re-run rolling the site back.
if [ "$(git rev-parse FETCH_HEAD)" != "$SHA" ]; then
@@ -96,7 +96,7 @@ jobs:
git reset --hard FETCH_HEAD
- name: Run docker compose up
working-directory: /home/adamf/deploy/web_server
working-directory: /home/adamf/deploy/stpweb
env:
COMPOSE_BAKE: "false"
# Shared with maintenance.yaml so the two never run compose at once.
+3 -3
View File
@@ -25,11 +25,11 @@ jobs:
# .compose.lock is shared with deploy.yaml, so two compose runs
# never race. Taken per step to keep deploys from waiting long.
- name: Pull latest base images
working-directory: /home/adamf/deploy/web_server
working-directory: /home/adamf/deploy/stpweb
run: flock .compose.lock docker compose pull
- name: Rebuild and restart containers
working-directory: /home/adamf/deploy/web_server
working-directory: /home/adamf/deploy/stpweb
run: flock .compose.lock docker compose up -d --build --remove-orphans
- name: Prune unused Docker images
@@ -40,7 +40,7 @@ jobs:
- name: Show running containers
run: docker compose ps
working-directory: /home/adamf/deploy/web_server
working-directory: /home/adamf/deploy/stpweb
- name: Show disk usage after
run: df -h /
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
-e RENOVATE_PLATFORM=gitea \
-e RENOVATE_ENDPOINT=http://git.adam-french.co.uk:3000/api/v1 \
-e RENOVATE_GIT_URL=endpoint \
-e RENOVATE_REPOSITORIES=adamf/web_server,adamf/stpgit \
-e RENOVATE_REPOSITORIES=adamf/stpweb,adamf/stpgit \
-e RENOVATE_TOKEN \
-e GITHUB_COM_TOKEN \
-e LOG_LEVEL=info \
+4 -4
View File
@@ -200,8 +200,8 @@ which has two jobs:
`.compose.lock` flock, shared with the weekly maintenance workflow.
The test job keeps state on the host outside the deploy checkout: a bare
repository cache at `/home/adamf/.cache/web_server-ci/` and three named
volumes (`web_server_ci_gomod`, `web_server_ci_gobuild`, `web_server_ci_pip`).
repository cache at `/home/adamf/.cache/stpweb-ci/` and three named
volumes (`stpweb_ci_gomod`, `stpweb_ci_gobuild`, `stpweb_ci_pip`).
The weekly maintenance workflow's `docker image prune -af` removes the two
toolchain images, so the first run after it pulls them again; the volumes
survive. Maintenance takes the same flock around its compose steps.
@@ -463,7 +463,7 @@ to be added to its allow-list as well as
`.env.example`.
**`.env` is edited by hand on the host**, in
`~/deploy/web_server`. Nothing syncs it from a laptop checkout, so a laptop's
`~/deploy/stpweb`. Nothing syncs it from a laptop checkout, so a laptop's
`.env` (often with dev values) never reaches production by accident.
An unset variable is not an error: compose substitutes an empty string,
@@ -524,7 +524,7 @@ together.
## 7. Runbook
All commands run from the deploy checkout on the host
(`~/deploy/web_server`) unless stated.
(`~/deploy/stpweb`) unless stated.
**Deploy.** Normally automatic — push to `main` and the Gitea Actions runner does
it. By hand:
+1 -1
View File
@@ -68,7 +68,7 @@ check-compose:
# The image build runs `caddy validate` for both modes.
check-caddy:
docker build -q -t web_server-caddy:check caddy/
docker build -q -t stpweb-caddy:check caddy/
generate:
cd backend && go run github.com/99designs/gqlgen generate
+3 -3
View File
@@ -152,7 +152,7 @@ func TestParseCommitMessage(t *testing.T) {
func TestGiteaFeedResponseDecoding(t *testing.T) {
const fixture = `[{
"act_user": {"avatar_url": "http://gitea:3000/avatars/1", "login": "adamf"},
"repo": {"full_name": "adamf/web_server", "html_url": "http://gitea:3000/adamf/web_server"},
"repo": {"full_name": "adamf/stpweb", "html_url": "http://gitea:3000/adamf/stpweb"},
"op_type": "commit_repo",
"content": "{\"Commits\":[{\"Message\":\"add tests\"}]}",
"created": "2026-09-22T10:30:00Z",
@@ -171,10 +171,10 @@ func TestGiteaFeedResponseDecoding(t *testing.T) {
if got.ActUser.AvatarURL != "http://gitea:3000/avatars/1" {
t.Errorf("AvatarURL = %q", got.ActUser.AvatarURL)
}
if got.Repo.FullName != "adamf/web_server" {
if got.Repo.FullName != "adamf/stpweb" {
t.Errorf("FullName = %q", got.Repo.FullName)
}
if got.Repo.HTMLURL != "http://gitea:3000/adamf/web_server" {
if got.Repo.HTMLURL != "http://gitea:3000/adamf/stpweb" {
t.Errorf("HTMLURL = %q", got.Repo.HTMLURL)
}
if got.OpType != "commit_repo" {
+3 -3
View File
@@ -134,9 +134,9 @@ GIT_HOST=${BASE#*://}
GIT="https://git.${GIT_HOST#www.}"
must 301 "$GIT/" gitea /gitea
must 301 "$GIT/" gitea /gitea/
must 301 "$GIT/adamf/web_server/src/branch/main/README.md" gitea /gitea/adamf/web_server/src/branch/main/README.md
must 301 "$GIT/adamf/web_server.git/info/refs?service=git-upload-pack" gitea "/gitea/adamf/web_server.git/info/refs?service=git-upload-pack"
must 301 "$GIT/adamf/web_server/commit/0000000" gitea /gitea/adamf/web_server/commit/0000000
must 301 "$GIT/adamf/stpweb/src/branch/main/README.md" gitea /gitea/adamf/stpweb/src/branch/main/README.md
must 301 "$GIT/adamf/stpweb.git/info/refs?service=git-upload-pack" gitea "/gitea/adamf/stpweb.git/info/refs?service=git-upload-pack"
must 301 "$GIT/adamf/stpweb/commit/0000000" gitea /gitea/adamf/stpweb/commit/0000000
echo "# bare prefixes and moved URLs"
for p in /api /radio /dozzle /garage /notes /sb /py /jobs /usaco \
+3
View File
@@ -2,6 +2,9 @@
# Container names come from the *_HOST variables in .env, which Caddy also
# uses for its upstreams, so the two always agree.
# Pinned to the old folder name: the volumes and network are named after it.
name: web_server
networks:
# Subnet pinned so it cannot collide with the LAN.
app-network:
+2 -2
View File
@@ -131,9 +131,9 @@ import Project from "./Project.vue";
<template v-slot:left>
<h4>
<a
href="https://www.adam-french.co.uk/gitea/adamf/web_server.git"
href="https://www.adam-french.co.uk/gitea/adamf/stpweb.git"
>
web_server.git
stpweb.git
</a>
</h4>
</template>
+2 -2
View File
@@ -66,9 +66,9 @@ import Project from "./Project.vue";
<template v-slot:left>
<h4>
<a
href="https://www.adam-french.co.uk/gitea/adamf/web_server.git"
href="https://www.adam-french.co.uk/gitea/adamf/stpweb.git"
>
web_server.git
stpweb.git
</a>
</h4>
</template>
+2 -2
View File
@@ -66,9 +66,9 @@ import Project from "./Project.vue";
<template v-slot:left>
<h4>
<a
href="https://www.adam-french.co.uk/gitea/adamf/web_server.git"
href="https://www.adam-french.co.uk/gitea/adamf/stpweb.git"
>
web_server.git
stpweb.git
</a>
</h4>
</template>
+2 -2
View File
@@ -67,9 +67,9 @@ import Project from "./Project.vue";
<template v-slot:left>
<h4>
<a
href="https://www.adam-french.co.uk/gitea/adamf/web_server.git"
href="https://www.adam-french.co.uk/gitea/adamf/stpweb.git"
>
web_server.git
stpweb.git
</a>
</h4>
</template>
+2 -2
View File
@@ -65,9 +65,9 @@ import Project from "./Project.vue";
<template v-slot:left>
<h4>
<a
href="https://www.adam-french.co.uk/gitea/adamf/web_server.git"
href="https://www.adam-french.co.uk/gitea/adamf/stpweb.git"
>
web_server.git
stpweb.git
</a>
</h4>
</template>