ci: publish image to the own registry on release tag #19

Merged
Noel merged 5 commits from feat/registry into main 2026-10-24 17:33:26 +00:00
Owner

Build Dockerfile on every v* tag push (created by release-please when the
release PR merges) and push registry.noelsabia.dev/cv_website/nuxt as the
version, sha-<12> and latest. Main pushes do not build: the registry holds
releases, not commits.

The job runs in node:22-bookworm and needs only the Docker client, so the
act_runner must expose its host socket (container.docker_host: automount);
a preflight step fails with that cause when it does not.

Build Dockerfile on every v* tag push (created by release-please when the release PR merges) and push registry.noelsabia.dev/cv_website/nuxt as the version, sha-<12> and latest. Main pushes do not build: the registry holds releases, not commits. The job runs in node:22-bookworm and needs only the Docker client, so the act_runner must expose its host socket (container.docker_host: automount); a preflight step fails with that cause when it does not.
Noel added 1 commit 2026-10-24 17:04:26 +00:00
ci: publish image to the own registry on release tag
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m16s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 10s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 41s
c3cf1dfc47
Build Dockerfile on every v* tag push (created by release-please when the
release PR merges) and push registry.noelsabia.dev/cv_website/nuxt as the
version, sha-<12> and latest. Main pushes do not build: the registry holds
releases, not commits.

The job runs in node:22-bookworm and needs only the Docker client, so the
act_runner must expose its host socket (container.docker_host: automount);
a preflight step fails with that cause when it does not.
Author
Owner



build · claude-haiku-5-5
→ Read .pr-review-diff.patch
build · claude-haiku-5-5
[BLOCKER] .gitea/workflows/publish-image.yml:48 (and the docker_host: automount setup in the Check daemon access step, lines 50-55): Automounting the host Docker socket gives every job on that runner root-equivalent access to the host. A job can run docker run -v /:/host ... and read or change anything on the machine that also runs k3s and Gitea. The doc says this runner is shared with the PR checks, which run code from PR branches. A PR that edits a workflow or a script could then take over the production node. Fix: run this job on a dedicated runner label that has the socket mounted and that PR-triggered jobs cannot use. Alternatively, build with rootless BuildKit or Kaniko and remove the socket from the shared runner. If PR jobs can never reach this runner, downgrade this to WARN and document that boundary.

[WARN] .gitea/workflows/publish-image.yml:116 and :104: latest is moved on every v* push, including pre-releases such as v1.3.0-rc1, and on manual re-runs of old tags. A re-run of v1.2.0 after v1.3.0 would move latest back to the older release. Fix: only tag latest when the version matches ^v[0-9]+\.[0-9]+\.[0-9]+$, and skip it on re-runs or check that the tag is the newest release.

[WARN] .gitea/workflows/publish-image.yml:64: The check v[0-9]* is a prefix match, so v1-anything passes and becomes a registry tag. Fix: use a regex such as [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]. This also settles the pre-release question above.

[WARN] .gitea/workflows/publish-image.yml:113-116: Images are pushed with no check that they start. The decision doc itself says the arm64 build has never been run. Fix: run docker run --rm "${IMAGE}:${VERSION}" node -e "process.exit(0)" or a health probe before the push steps. Add --pull to the build step so the base image is current.

[WARN] .gitea/workflows/publish-image.yml:105: The build context is ., so the whole repository, including any .env or .git files, is sent to the daemon. The diff does not include .dockerignore, so I could not confirm those are excluded. Fix: confirm that .dockerignore excludes .env*, .git, and any local secret files, and that the Dockerfile copies only the build output.

[NIT] .gitea/workflows/publish-image.yml:26: The job has no timeout-minutes, and a stuck build holds the capacity-1 runner. Add a timeout.

[NIT] .gitea/workflows/publish-image.yml:42: Debian's docker.io client may not match the host daemon's API version. Pin the client version, or check it against the daemon in Check daemon access.

VERDICT: REQUEST_CHANGES

 > build · claude-haiku-5-5 → Read .pr-review-diff.patch > build · claude-haiku-5-5 [BLOCKER] .gitea/workflows/publish-image.yml:48 (and the `docker_host: automount` setup in the `Check daemon access` step, lines 50-55): Automounting the host Docker socket gives every job on that runner root-equivalent access to the host. A job can run `docker run -v /:/host ...` and read or change anything on the machine that also runs k3s and Gitea. The doc says this runner is shared with the PR checks, which run code from PR branches. A PR that edits a workflow or a script could then take over the production node. Fix: run this job on a dedicated runner label that has the socket mounted and that PR-triggered jobs cannot use. Alternatively, build with rootless BuildKit or Kaniko and remove the socket from the shared runner. If PR jobs can never reach this runner, downgrade this to WARN and document that boundary. [WARN] .gitea/workflows/publish-image.yml:116 and :104: `latest` is moved on every `v*` push, including pre-releases such as `v1.3.0-rc1`, and on manual re-runs of old tags. A re-run of `v1.2.0` after `v1.3.0` would move `latest` back to the older release. Fix: only tag `latest` when the version matches `^v[0-9]+\.[0-9]+\.[0-9]+$`, and skip it on re-runs or check that the tag is the newest release. [WARN] .gitea/workflows/publish-image.yml:64: The check `v[0-9]*` is a prefix match, so `v1-anything` passes and becomes a registry tag. Fix: use a regex such as `[[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]`. This also settles the pre-release question above. [WARN] .gitea/workflows/publish-image.yml:113-116: Images are pushed with no check that they start. The decision doc itself says the arm64 build has never been run. Fix: run `docker run --rm "${IMAGE}:${VERSION}" node -e "process.exit(0)"` or a health probe before the push steps. Add `--pull` to the build step so the base image is current. [WARN] .gitea/workflows/publish-image.yml:105: The build context is `.`, so the whole repository, including any `.env` or `.git` files, is sent to the daemon. The diff does not include `.dockerignore`, so I could not confirm those are excluded. Fix: confirm that `.dockerignore` excludes `.env*`, `.git`, and any local secret files, and that the Dockerfile copies only the build output. [NIT] .gitea/workflows/publish-image.yml:26: The job has no `timeout-minutes`, and a stuck build holds the capacity-1 runner. Add a timeout. [NIT] .gitea/workflows/publish-image.yml:42: Debian's `docker.io` client may not match the host daemon's API version. Pin the client version, or check it against the daemon in `Check daemon access`. VERDICT: REQUEST_CHANGES
Noel added 2 commits 2026-10-24 17:15:57 +00:00
# Conflicts:
#	OKF_Nuxt/log.md
fix(ci): harden the release publish workflow after the PR review
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m5s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 8s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 48s
435be63ae0
Applied the findings that held up against the code:
- strict vMAJOR.MINOR.PATCH guard; v[0-9]* accepted v1, v1-foo and
  prereleases, all valid registry tags
- latest now follows the newest release, so replaying an older tag cannot
  drag it backwards; skipped with a warning if the tag list is unavailable
- smoke test starts the built image and requires 2xx on / before pushing
- timeout-minutes: 20 on the job, so a hung build cannot hold the
  capacity-1 runner indefinitely
- the decision doc records the socket's blast radius: root-equivalent,
  runner-wide, only on a label PR jobs cannot use

Rejected with evidence: the .dockerignore leak (.env*, *.pem, .git are
excluded) and the Docker client/daemon API mismatch (20.10.24 client
against a 29.9.2 daemon builds over the socket).
Author
Owner



build · claude-haiku-5-5
→ Read .pr-review-diff.patch
build · claude-haiku-5-5
→ Read .pr-review-diff.patch [offset=390]
build · claude-haiku-5-5
✱ Grep "runs-on|on:|pull_request|PORT|HOST" in . · 100 matches
✱ Glob "{Dockerfile,.gitea/workflows/*.yml}" 1 match
build · claude-haiku-5-5
[BLOCKER] .gitea/workflows/publish-image.yml:28 - runs-on: ubuntu-latest is the same label that pr-checker.yml uses on pull_request (lines 27, 80, 110, and others). The workflow's own "Check daemon access" step requires docker_host: automount, which is runner-wide. Once an operator enables it, PR-triggered code runs with a root-equivalent Docker socket on the host, which also exposes Gitea, k3s, and the CV. The repo's own trust-boundary rule (OKF_Nuxt/decisions/registry-publishing.md) forbids this layout. Fix: set runs-on to a dedicated label (for example publish) registered on a separate act_runner that has docker_host: automount, and confirm pr-checker.yml never selects that label.

[WARN] .gitea/workflows/publish-image.yml:180-181 (push step) - Version tags are mutable. A replayed run of vX.Y.Z silently overwrites the existing :vX.Y.Z and :sha-* tags with a rebuilt image, so a release can change content after it was published. Fix: before building, check whether ${IMAGE}:${VERSION} already exists in the registry (for example with docker manifest inspect) and fail unless a re-run is explicitly requested.

[WARN] .gitea/workflows/publish-image.yml:135-151 (smoke test) - The readiness loop only checks /. A server that answers 2xx on / while crashing on the first real request still passes, and the & background process is not reaped by sh as PID 1. Fix: also request one API route the site depends on, and run the container with --init.

VERDICT: REQUEST_CHANGES

 > build · claude-haiku-5-5 → Read .pr-review-diff.patch > build · claude-haiku-5-5 → Read .pr-review-diff.patch [offset=390] > build · claude-haiku-5-5 ✱ Grep "runs-on|on:|pull_request|PORT|HOST" in . · 100 matches ✱ Glob "{Dockerfile,.gitea/workflows/*.yml}" 1 match > build · claude-haiku-5-5 [BLOCKER] .gitea/workflows/publish-image.yml:28 - `runs-on: ubuntu-latest` is the same label that `pr-checker.yml` uses on `pull_request` (lines 27, 80, 110, and others). The workflow's own "Check daemon access" step requires `docker_host: automount`, which is runner-wide. Once an operator enables it, PR-triggered code runs with a root-equivalent Docker socket on the host, which also exposes Gitea, k3s, and the CV. The repo's own trust-boundary rule (`OKF_Nuxt/decisions/registry-publishing.md`) forbids this layout. Fix: set `runs-on` to a dedicated label (for example `publish`) registered on a separate act_runner that has `docker_host: automount`, and confirm `pr-checker.yml` never selects that label. [WARN] .gitea/workflows/publish-image.yml:180-181 (push step) - Version tags are mutable. A replayed run of `vX.Y.Z` silently overwrites the existing `:vX.Y.Z` and `:sha-*` tags with a rebuilt image, so a release can change content after it was published. Fix: before building, check whether `${IMAGE}:${VERSION}` already exists in the registry (for example with `docker manifest inspect`) and fail unless a re-run is explicitly requested. [WARN] .gitea/workflows/publish-image.yml:135-151 (smoke test) - The readiness loop only checks `/`. A server that answers 2xx on `/` while crashing on the first real request still passes, and the `&` background process is not reaped by `sh` as PID 1. Fix: also request one API route the site depends on, and run the container with `--init`. VERDICT: REQUEST_CHANGES
Noel added 1 commit 2026-10-24 17:24:48 +00:00
fix(ci): publish on a dedicated runner label, immutable version tags
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m6s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 48s
eebd6ca697
The review's blocker was real: runs-on: ubuntu-latest is the label
pr-checker.yml uses, and the job needs a runner-wide Docker socket, so the
only working configuration violated the trust boundary in the decision
doc. The job now runs on a dedicated 'publish' label that only a second
act_runner registration (docker_host: automount) may carry.

Version tags are now immutable: before building, the registry v2 API is
asked for manifests/<version> and 200 aborts the run. docker manifest
inspect cannot do this job - the pinned Debian 20.10 client fails on OCI
indexes for existing and missing tags alike (measured).

Also: the smoke test requires a rendered body (10 kB floor) on top of the
2xx, .github/actionlint.yaml declares the custom label, and the actionlint
hook passes that config explicitly because this repo keeps workflows in
.gitea/workflows, where actionlint does not auto-discover it.
Author
Owner



build · claude-haiku-5-5
→ Read .pr-review-diff.patch
build · claude-haiku-5-5
✱ Grep "ENTRYPOINT|CMD|PORT|HOST|USER|output" in Dockerfile · 9 matches
build · claude-haiku-5-5
[WARN] .gitea/workflows/publish-image.yml:148 - The registry password is passed as a curl -u argument, so it appears in the process argv. That contradicts the rationale in OKF_Nuxt/decisions/registry-publishing.md ("the value never appears in the process list"). The same call has no --max-time, so a stalled registry consumes the job's 20-minute budget. Fix: pass credentials via curl -K - with the auth line fed on stdin, or use --netrc-file, and add --max-time 30.

[WARN] .gitea/workflows/publish-image.yml:221-230 - Push order can leave the release unrecoverable. :vX.Y.Z is pushed first. If the sha- or :latest push then fails, the immutability guard at line 130-146 returns 200 on the next run and aborts, so the only fix is a manual registry deletion. Fix: push sha-<SHA> and :latest first, and push :${VERSION} last so the immutable tag marks a completed publish. The same ordering is already implied by the guard's stated purpose.

[NIT] .gitea/workflows/publish-image.yml:153 - The version-existence probe uses curl -s without --fail or --max-time. Any non-HTTP failure yields 000 and falls into the generic error branch. That is correct, but a timeout-only override would make failures easier to diagnose. Add --max-time 30 and print curl's exit code alongside ${code}.

[NIT] .gitea/workflows/publish-image.yml:217-219 - docker tag ... :latest runs before the push step, so a failed push still leaves a local :latest on the shared daemon. Other jobs on the same daemon could pick it up. Fix: tag inside the push step, immediately before docker push "${IMAGE}:latest".

Checked and not findings: the Dockerfile has no ENTRYPOINT, so the sh -c smoke test overrides CMD correctly, and its port 3000 matches PORT=3000. The .github/actionlint.yaml schema and the pre-commit -config-file flag are correct.

VERDICT: APPROVE

 > build · claude-haiku-5-5 → Read .pr-review-diff.patch > build · claude-haiku-5-5 ✱ Grep "ENTRYPOINT|CMD|PORT|HOST|USER|output" in Dockerfile · 9 matches > build · claude-haiku-5-5 [WARN] .gitea/workflows/publish-image.yml:148 - The registry password is passed as a `curl -u` argument, so it appears in the process argv. That contradicts the rationale in `OKF_Nuxt/decisions/registry-publishing.md` ("the value never appears in the process list"). The same call has no `--max-time`, so a stalled registry consumes the job's 20-minute budget. Fix: pass credentials via `curl -K -` with the auth line fed on stdin, or use `--netrc-file`, and add `--max-time 30`. [WARN] .gitea/workflows/publish-image.yml:221-230 - Push order can leave the release unrecoverable. `:vX.Y.Z` is pushed first. If the `sha-` or `:latest` push then fails, the immutability guard at line 130-146 returns 200 on the next run and aborts, so the only fix is a manual registry deletion. Fix: push `sha-<SHA>` and `:latest` first, and push `:${VERSION}` last so the immutable tag marks a completed publish. The same ordering is already implied by the guard's stated purpose. [NIT] .gitea/workflows/publish-image.yml:153 - The version-existence probe uses `curl -s` without `--fail` or `--max-time`. Any non-HTTP failure yields `000` and falls into the generic error branch. That is correct, but a timeout-only override would make failures easier to diagnose. Add `--max-time 30` and print `curl`'s exit code alongside `${code}`. [NIT] .gitea/workflows/publish-image.yml:217-219 - `docker tag ... :latest` runs before the push step, so a failed push still leaves a local `:latest` on the shared daemon. Other jobs on the same daemon could pick it up. Fix: tag inside the push step, immediately before `docker push "${IMAGE}:latest"`. Checked and not findings: the Dockerfile has no ENTRYPOINT, so the `sh -c` smoke test overrides CMD correctly, and its port 3000 matches `PORT=3000`. The `.github/actionlint.yaml` schema and the pre-commit `-config-file` flag are correct. VERDICT: APPROVE
Noel added 1 commit 2026-10-24 17:31:01 +00:00
Merge remote-tracking branch 'origin/main' into feat/registry
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m8s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 8s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 49s
c3445ad55d
# Conflicts:
#	OKF_Nuxt/log.md
Author
Owner



build · claude-haiku-5-5
→ Read .pr-review-diff.patch
build · claude-haiku-5-5
The diff contains no application code (no Nuxt or Go changes). The reviewable parts are the Gitea release workflow, the actionlint and pre-commit config, and the docs.

[WARN] .gitea/workflows/publish-image.yml:148 - The registry password is passed as a curl -u user:pass argument, so it is visible in the process list. The decision doc (OKF_Nuxt/decisions/registry-publishing.md, Secrets section) says --password-stdin keeps the value out of the process list, which is only true for docker login. Fix: pass credentials through stdin or a config file, e.g. printf 'user = "%s:%s"\n' "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD" | curl -K - ..., and correct the doc.

[WARN] .gitea/workflows/publish-image.yml:130-159 and 215-230 - The immutability guard turns a partial failure into a permanent block. Pushes run version, then sha, then latest (lines 223-226). If the first push succeeds and a later one fails, a rerun hits 200 on :vX.Y.Z and aborts, so :sha- and :latest are never pushed and manual registry deletion is required. Fix: push sha- and latest first and :vX.Y.Z last, so a version tag only exists after a complete publish. Or skip the version push (but not the others) when the guard finds the tag already exists.

[WARN] .gitea/workflows/publish-image.yml:44 and :42 - actions/checkout@v4 and node:22-bookworm are mutable references, and this job holds a root-equivalent Docker socket on the host. The workflow's own trust-boundary reasoning calls for pinning. Fix: pin the action to a full commit SHA and the container image to a digest.

[NIT] .gitea/workflows/publish-image.yml:52 - The log entry says the Debian docker.io 20.10 client built successfully against a 29.x daemon. Newer Docker Engine releases raise the minimum accepted client API version, which could make docker info and docker build fail with "client version too old". Confirm this against the actual runner daemon before the first release tag, since Check daemon access would fail on the first release.

VERDICT: APPROVE

 > build · claude-haiku-5-5 → Read .pr-review-diff.patch > build · claude-haiku-5-5 The diff contains no application code (no Nuxt or Go changes). The reviewable parts are the Gitea release workflow, the actionlint and pre-commit config, and the docs. [WARN] .gitea/workflows/publish-image.yml:148 - The registry password is passed as a `curl -u user:pass` argument, so it is visible in the process list. The decision doc (`OKF_Nuxt/decisions/registry-publishing.md`, Secrets section) says `--password-stdin` keeps the value out of the process list, which is only true for `docker login`. Fix: pass credentials through stdin or a config file, e.g. `printf 'user = "%s:%s"\n' "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD" | curl -K - ...`, and correct the doc. [WARN] .gitea/workflows/publish-image.yml:130-159 and 215-230 - The immutability guard turns a partial failure into a permanent block. Pushes run version, then sha, then latest (lines 223-226). If the first push succeeds and a later one fails, a rerun hits `200` on `:vX.Y.Z` and aborts, so `:sha-` and `:latest` are never pushed and manual registry deletion is required. Fix: push `sha-` and `latest` first and `:vX.Y.Z` last, so a version tag only exists after a complete publish. Or skip the version push (but not the others) when the guard finds the tag already exists. [WARN] .gitea/workflows/publish-image.yml:44 and :42 - `actions/checkout@v4` and `node:22-bookworm` are mutable references, and this job holds a root-equivalent Docker socket on the host. The workflow's own trust-boundary reasoning calls for pinning. Fix: pin the action to a full commit SHA and the container image to a digest. [NIT] .gitea/workflows/publish-image.yml:52 - The log entry says the Debian `docker.io` 20.10 client built successfully against a 29.x daemon. Newer Docker Engine releases raise the minimum accepted client API version, which could make `docker info` and `docker build` fail with "client version too old". Confirm this against the actual runner daemon before the first release tag, since `Check daemon access` would fail on the first release. VERDICT: APPROVE
Noel merged commit 8150cd689f into main 2026-10-24 17:33:26 +00:00
Noel deleted branch feat/registry 2026-10-24 17:33:26 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CV_Website/CV_Site_Nuxt#19