Skip to content

ci: publish the container image to docker hub - #12

Merged
dinhdev666 merged 1 commit into
mainfrom
chore/publish-docker-image
Nov 24, 2026
Merged

dinhdev666 merged 1 commit into
mainfrom
chore/publish-docker-image

Conversation

@dinhdev666

Copy link
Copy Markdown
Owner

Summary

  • Adds .github/workflows/docker-publish.yml: a v*.*.* tag builds linux/amd64 + linux/arm64 and pushes dinhdev666/opencode-router:<version> and :latest to Docker Hub. Follows the same shape as the provider project's publish workflow (tag-only, version gate, provenance + SBOM).
  • Three gates, all before the registry login: the job only runs on a v*.*.* tag (workflow_dispatch from a branch stops before it logs in), the tagged commit must already be on main, and every completed check run on it must be success/skipped/neutral. A tag that is not equal to version in package.json is refused too.
  • Documentation now names the published image instead of saying it does not exist: a tag table, docker pull/docker run, a "build from a checkout" subsection, and a "Publishing a release" section. README.md, AGENTS.md and CONTRIBUTING.md describe the same flow.
  • docker-compose.yml keeps building the checkout (opencode-router:local); it does not pull the published tag.
  • test/unit-docs.mjs replaces the old "no workflow publishes an image" invariant with the opposite one: the publish job must be tag-gated, ci.yml must never push, and the docs must name the image.

What this PR does not do

It does not publish anything. The publish job needs the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets, and no tag is pushed here.

Verification

  • pnpm run check (20 action references across 2 workflows, all pinned)
  • pnpm run test:unit (159/159)
  • pnpm run typecheck and pnpm run build are unaffected (no web/ or runtime change); CI runs them.

The image is the install, but nothing published it: README and
docker/README told a reader to build the tag themselves, and the docs
test asserted that no workflow may push one. A tag now publishes.

.github/workflows/docker-publish.yml builds both architectures from a
v*.*.* tag and pushes the version and latest. It is the only workflow
that may hold a write-scoped registry credential, so it refuses a tag
that is not on main, whose version differs from package.json, or whose
CI has not concluded green. A branch dispatch stops before it logs in:
the version gate is skipped for a non-tag ref.

The docs now name the published image - the tags, a pull and run
example, and how a release is published - and the compose file keeps
building the checkout so it still runs what you are editing. The test
section that forbade a publish workflow becomes the opposite invariant:
the publish job is tag-gated, CI never pushes, and the docs name the
image.
@dinhdev666
dinhdev666 merged commit 42c9b39 into main Nov 24, 2026
6 checks passed
@dinhdev666
dinhdev666 deleted the chore/publish-docker-image branch November 24, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant