Use shared runner image build action
All checks were successful
Build runner image / build (push) Successful in 6m48s
Test blackout notifier / test (push) Successful in 3s
Hourly blackout check / check (push) Successful in 4s

This commit is contained in:
Meghdad
2026-07-17 23:03:40 +03:30
parent b8d27a3298
commit 0abf377f53
5 changed files with 37 additions and 94 deletions

View File

@@ -77,7 +77,7 @@ The Node base image is also mirrored in Gitea, so image builds do not contact
Docker Hub:
```text
mahgit.ir/meghdadfadaee/daily-blackout-check-base:node-20-bookworm
mahgit.ir/meghdadfadaee/build-runner-image-base:node-20-bookworm
```
### Registry credentials
@@ -113,27 +113,32 @@ The runner container itself must already mount the same socket, as in the normal
Docker-based `act_runner` setup. Restart the runner after changing its config.
Docker socket access is equivalent to control of the Docker host. Use a trusted,
preferably repository-level runner. The build workflow runs only for changes on
`main` under `runner-image/` or its own workflow file; it never runs for pull
requests.
preferably repository-level runner. The build workflow runs only for changes to
the root image lock, `.dockerignore`, or its own workflow on `main`; it never
runs for pull requests.
### Image publishing flow
The **Build runner image** workflow:
1. Starts in the Gitea-hosted `daily-blackout-check-base:node-20-bookworm`
image and installs the Docker client.
2. Builds using only `runner-image/` as context, so `.env` and outage state are
never included.
3. Runs import, pytest, and Ruff smoke checks inside the candidate image.
4. Pushes an immutable tag using the first 12 characters of the Git commit.
5. Updates `latest` only after the candidate passes verification.
1. Starts in the shared Gitea-hosted `build-runner-image-base:node-20-bookworm`
image.
2. Calls the shared Gitea action
`MeghdadFadaee/build-runner-image-action@v1` to install the Docker client,
authenticate, build, verify, and publish.
3. Uses the action's shared Dockerfile with the root `requirements.lock`.
`.dockerignore` restricts the build context to that lock, so `.env`, source,
and outage state are never sent to Docker.
4. Runs import, pytest, and Ruff smoke checks inside the candidate image.
5. Pushes an immutable 12-character Git revision tag and updates `latest` only
after the candidate passes verification.
It runs automatically when `runner-image/**` changes on `main` and can also be
started manually. Image builds require Debian mirrors, PyPI, Gitea, and access
to the Docker socket. Normal test and hourly runs only need Gitea, `gitea.com`,
SAAPA, and EitaaYar. The mirrored Node image is intentionally static; refresh it
from the upstream `node:20-bookworm` image when adopting Node security updates.
It runs automatically when `requirements.lock`, `.dockerignore`, or its workflow
changes on `main`, and can also be started manually. Image builds require Debian
mirrors, PyPI, Gitea, and access to the Docker socket. Normal test and hourly
runs only need Gitea, `gitea.com`, SAAPA, and EitaaYar. The mirrored Node image
is intentionally static; refresh it from the upstream `node:20-bookworm` image
when adopting Node security updates.
Deployment order: