Skip to content

ci: publish Docker images to GHCR - #689

Open
hundehausen wants to merge 2 commits into
Cuprate:mainfrom
hundehausen:ci/ghcr-docker-publish
Open

ci: publish Docker images to GHCR#689
hundehausen wants to merge 2 commits into
Cuprate:mainfrom
hundehausen:ci/ghcr-docker-publish

Conversation

@hundehausen

@hundehausen hundehausen commented Aug 15, 2026

Copy link
Copy Markdown

What

Build the existing Dockerfile on main and on cuprated-* tags, and publish ghcr.io/cuprate/cuprated.

Event Tags written
Push or workflow_dispatch on main nightly, short SHA
Git tag cuprated-<version> <version>, latest, short SHA
PR that touches Dockerfile or this workflow none (local cuprated:testing only)

A main build never writes latest.

Why

cuprated already has an in-tree Dockerfile. This adds a workflow so official images are built from the same tree and published to GHCR.

Where

  • .github/workflows/docker.yml (new)
  • Dockerfile (builder GITHUB_SHA, OCI labels)
  • constants/build.rs (treat empty GITHUB_SHA as unset; rebuild when it changes)

How

git rev-parse HEAD after checkout is the commit used for GITHUB_SHA and for the smoke test. That avoids annotated-tag objects, which cuprated rejects because they are not a 40-character commit.

Per-arch jobs (linux/amd64 on ubuntu-24.04, linux/arm64 on ubuntu-24.04-arm) push only <commit>-amd64 / <commit>-arm64. After both pass docker run --rm "$IMG" --version (.commit must match the expected commit), a merge job writes the multi-arch tags with docker buildx imagetools create. A failed arch smoke test leaves the previous nightly / version / latest tags in place.

Actions in the new workflow are pinned to release SHAs. Existing workflows are unchanged.

Maintainer note: first GHCR publish

The workflow can publish the image. It cannot make that image publicly pullable. Package visibility is a GitHub Packages setting, not a workflow input, and it is independent of this repository being public.

The first successful push creates the cuprated container package under the Cuprate org (ghcr.io/cuprate/cuprated). GitHub’s default for a new container package is private. Until an org owner or package admin changes that:

  • This workflow can still push (packages: write + GITHUB_TOKEN).
  • Anonymous docker pull ghcr.io/cuprate/cuprated:nightly fails.
  • Only people with package read access can pull.

To make the official image public (one-time):

  1. After the first green main run, open the org package. It may only appear under the org’s private packages list at first.
  2. Package settings → Change visibility → Public.

Later pushes reuse the same package. Visibility stays public.

Build the existing Dockerfile on main and on cuprated-* tags.
Push ghcr.io/cuprate/cuprated (nightly from main; version + latest
from tags). Smoke-test --version before promoting multi-arch tags.

The first push creates a private GHCR package; set cuprated public
and optionally link it to the repository.
@github-actions github-actions Bot added A-workspace Area: Changes to a root workspace file or general repo file. A-ci Area: Related to CI. A-constants Area: Related to constants. labels Aug 15, 2026
Document ghcr.io/cuprate/cuprated tags and a pull/run example
for 0.1.0-preview.
@github-actions github-actions Bot added the A-docs Area: Related to documentation. label Aug 15, 2026
@Boog900 Boog900 added this to the cuprated v0.1.0 preview 2 milestone Aug 20, 2026
@hundehausen
hundehausen marked this pull request as ready for review August 22, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci Area: Related to CI. A-constants Area: Related to constants. A-docs Area: Related to documentation. A-workspace Area: Changes to a root workspace file or general repo file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants