Skip to content

Publish the Docker image automatically on release #459

Description

@7sharp9

Follow-up to #234, item 3 ("Releasing a docker image on publish"). Deferred out of
#234's scope by ADR-0021
(decision 4), which kept #234 focused on versioning/changelog automation.

Problem

dotnet run DockerBuild builds halcwb/genpres locally and labels it with the
<Version> from the root Directory.Build.props, but nothing publishes it. Every
release image is built and pushed by hand, so there is no guarantee that a published
tag corresponds to the commit that produced the matching CHANGELOG.md entry.

What's already in place

  • Dockerfile takes an APP_VERSION build arg and writes it to
    org.opencontainers.image.version.
  • DockerBuild / DockerRun FAKE targets (Build.fs), with DOCKER_IMAGE and
    DOCKER_PLATFORM overrides.
  • EasyBuild.ShipIt now owns version derivation and opens the release PR
    (.github/workflows/release.yml), so there is a well-defined "a release happened"
    event to hang publishing off.

Scope to decide

  • Trigger: on the release PR merging, on a git tag, or on a GitHub Release being
    published. ShipIt's behaviour on merge determines which of these actually fires.
  • Registry: Docker Hub (halcwb/genpres, matching the current default) vs GHCR.
    Needs a credentials/secrets decision either way.
  • Tags to push: :<version>, :latest, and whether pre-release versions
    (0.1.2-alpha.N) should move :latest at all — currently every release is a
    pre-release, so :latest semantics need settling before this is switched on.
  • Multi-arch (linux/amd64 + linux/arm64) via buildx, or single-arch to start.
  • Whether the published image is smoke-tested before the tag is considered good.

Constraints

  • GENPRES_URL_ID and GENPRES_PASSWORD must not be baked into the image
    (see DEVELOPMENT.md § Environment Configuration) — no --build-arg for either.
    A publish workflow must not introduce them as build args by accident.
  • Publishing must not block the test/format matrix in build.yml, for the same
    reason release.yml is a separate workflow.

Likely wants an ADR-0021 amendment rather than a new ADR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    automationAutomated processes, scripts, or scheduled tasksbuildIssues with the build system, CI, or compilationtoolingDeveloper tooling, scripts, or project infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions