Files
CV_Site_Nuxt/OKF_Nuxt/decisions/registry-publishing.md
T
Noel Sabia c3cf1dfc47
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
ci: publish image to the own registry on release tag
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.
2026-10-24 19:02:54 +02:00

4.6 KiB

type, title, description, tags, status, generated, verified, sources
type title description tags status generated verified sources
Decision Publishing images to the own registry A release tag builds the production image and pushes it to registry.noelsabia.dev, because that is the only way Kubernetes can pull it.
decision
ci
docker
registry
gitea-actions
draft
by at
opencode-go/deepseek-v4.1-flash 2026-10-24T00:00:00Z
by at
human:noel not yet
id resource title
workflow .gitea/workflows/publish-image.yml Publish image workflow
id resource title
dockerfile Dockerfile Production Dockerfile
id resource title
k8s ../OKF_CV_Website/architecture/delivery.md Sibling bundle - image tags and registry pull

Decision

.gitea/workflows/publish-image.yml builds Dockerfile and pushes the result to the own registry:

registry.noelsabia.dev/cv_website/nuxt:v1.2.3
registry.noelsabia.dev/cv_website/nuxt:sha-<12-char-sha>
registry.noelsabia.dev/cv_website/nuxt:latest

Trigger is the release tag, not the main push. release-please creates vX.Y.Z when the release PR is merged (release engineering); that tag push is the build. A main push would otherwise publish commits that no release describes, and latest would move on work in progress.

Why not build on every main push

  • The registry is the deployment channel. Every image in it should answer "which release is this", and a tagged commit does.
  • The runner has capacity 1 and shares 2 vCPU / 4 GB with Gitea and k3s (OKF_CV_Website/architecture/server-budget.md). A Nuxt image build can take over 1 GB; running it more often than a release buys nothing.
  • The PR checks already gate the code that becomes a release. A tag build is not the first time the tree is built - a failing build here is a packaging failure, not a surprise.

Why docker-outside-of-docker

The job runs in node:22-bookworm, like every other job in this repository, and only needs the Docker client: docker build sends the build context over the socket, so the daemon never reads the container's filesystem. That requires the act_runner to mount its host socket:

# act_runner config.yaml
container:
  docker_host: automount

Without it the Check daemon access step fails first with a named cause instead of a mid-build error. The alternative - a privileged docker:dind sidecar - needs privileged mode and a second daemon per release; not worth it on this server.

Why --platform linux/arm64

The runner and the node are the same arm64 machine, so the build is native (no QEMU, no crossed dependencies). Stating the platform makes a build on another architecture fail instead of publishing an image the node cannot run.

Secrets

Gitea secret Use
REGISTRY_USERNAME basic-auth user for docker login registry.noelsabia.dev
REGISTRY_PASSWORD basic-auth password (or token) for the same login

Both are repo secrets. The login uses --password-stdin so the value never appears in the process list or the log.

Costs and consequences

  • Registry storage grows by one image per release in three tags. The three tags share layers, so the extra cost is mostly the tag, not the bytes.
  • Images accumulate on the runner's daemon (sha-, version and latest tags). Pruning is not part of this change; add a docker image prune policy when the disk usage actually matters.
  • latest is a convenience, not a pin. Manifests should reference the version or SHA tag so a release rollback is a manifest edit.
  • k3s needs pull credentials: an imagePullSecret in the namespace for the same basic-auth pair, or /etc/rancher/k3s/registries.yaml if the registry is ever plain HTTP. Not part of this workflow.

Not verified

  • That the runner has the host socket mounted (docker_host: automount) - the workflow's first step answers this on the first release.
  • That the arm64 build succeeds: Dockerfile has been built on x86_64 only (production image).
  • That registry.noelsabia.dev is reachable over HTTPS from the runner. A plain-HTTP endpoint fails docker login with server gave HTTP response to HTTPS client and needs insecure-registries on the daemon plus registries.yaml on k3s.

Revisit when

  • A second image (the Go gateway or chapter service) needs publishing - then the workflow grows a matrix instead of being copied.
  • Deploys should follow automatically: the release workflow gains a kubectl set image step, or manifests start referencing the SHA tag.
  • Multi-arch becomes necessary (a laptop or a CI host of the other architecture pulls the image).