Single-container image publication
.github/workflows/single-container-image.yml builds deploy/Dockerfile.single
(the application) and deploy/Dockerfile.migrator (the schema migrator), and
publishes both to the public GitHub Container Registry when a GitHub Release is
published. It is separate from the release-candidate workflow and
does not change its gates.
Naming
The naming is inspired by Uptime Kuma: the release title equals the tag, the GitHub prerelease flag follows the version suffix, and images carry the exact version, a major tag and a channel tag.
| Item | Format | Example |
|---|---|---|
| Git tag and release title | v<major>.<minor>.<patch> or v<major>.<minor>.<patch>-<channel>.<n>, channel alpha, beta or rc | v0.1.0-alpha.1 |
| Image tag | the tag without v | 0.1.0-alpha.1 |
| GitHub release | prerelease if and only if the tag has a suffix | alpha, beta and rc are prereleases |
The first release is v0.1.0-alpha.1. The workflow accepts only
^v\d+\.\d+\.\d+(-[a-z]+\.\d+)?$ with the channel restricted to alpha, beta
and rc, and refuses a release whose prerelease flag disagrees with the suffix.
Images are ghcr.io/payloadbay/payloadbay (application) and
ghcr.io/payloadbay/payloadbay-migrator (the one-shot schema service). Both get
the same tags:
| Release | Tags pushed |
|---|---|
v0.1.0-alpha.1 | 0.1.0-alpha.1, alpha |
v0.1.0-beta.2 | 0.1.0-beta.2, beta |
v1.0.0-rc.1 | 1.0.0-rc.1, rc |
v1.4.2 | 1.4.2, 1.4, 1, latest |
- A prerelease never gets
latest, a<major>or a<major>.<minor>tag. - A floating tag moves only when the release is the newest in its line: a patch
for an older line (
v1.3.9afterv2.0.0) does not movelatestor1, and an older prerelease does not move its channel tag. - An exact version tag is never overwritten. The publish job stops if it already exists; publish a new version instead.
- There is no
nightlyimage.
Operators should pin the exact version, preferably with its digest. Floating tags
(alpha, 1, latest) can change under a running installation.
What runs automatically
On pull requests that touch the image inputs, and on manual runs of the workflow
(Actions, "Single-container image", "Run workflow", which is a dry run and has no
option to publish), the build-test job:
- builds the
linux/amd64image and loads it locally, never pushing; - starts it with
deploy/compose.single.ymland a throwaway PostgreSQL with generated secrets, and waits for the container to report healthy; - runs
scripts/release/smoke-single.sh, which requires the setup page to answer 200 and/api/v1/healthto answer with a JSON body (200, or 401 for an anonymous caller); - outside pull requests, also builds both images for
linux/amd64,linux/arm64(arm64 through QEMU) without pushing.
A pull request, a tag push or a manual run never publishes.
Release procedure (maintainer only)
- Merge the change to
masterand wait for CI on that exact commit to succeed. Confirm the changelog, known limitations and any breaking change. - Create the release from a new tag on that commit: in GitHub, Releases, "Draft
a new release", choose "Create new tag on publish" with target
master(or a tag you already created on the commit), tagv0.1.0-alpha.1, title equal to the tag, "Generate release notes" (categories come from.github/release.yml), edit the notes, and tick "Set as a pre-release" for any tag with a suffix. With the CLI:gh release create v0.1.0-alpha.1 --target <full-sha> --title v0.1.0-alpha.1 --generate-notes --prerelease(leave out--prereleasefor a stable version). - Publishing the release starts the workflow. The
validatejob requires the tag format, a matching prerelease flag, a tagged commit that is onmaster, and a successfulCI validationcheck run for that commit. In parallel thebuild-testjob builds and smoke-tests the images without pushing. - The
publishjob then waits for approval of the protectedreleaseenvironment. Review the run and approve it in the run page ("Review deployments"). Nothing is pushed before this approval. - After approval the job builds both images for
linux/amd64andlinux/arm64, pushes the tags above with a BuildKit SBOM andmode=maxprovenance, adds a GitHub build-provenance attestation for each digest, and writes the pushed digests to the run summary. - The first time only: GHCR creates the package as private. In the organization's
packages, open each of
payloadbayandpayloadbay-migrator, link it to the repository if it is not already, and set the visibility to public (Package settings, Danger Zone, Change visibility). This cannot be done from the workflow and stays public afterwards. - Verify the image (below), then pin the hosted instance to the digest from the run summary and redeploy; see deploying a published image.
If validation or the build fails, nothing is published. Delete the release and its
tag, fix the cause on master and release a new version; never reuse a version
whose images were pushed.
The workflow only publishes images. It does not edit the release, create tags or upload assets.
Verify
gh attestation verify oci://ghcr.io/payloadbay/payloadbay:0.1.0-alpha.1 --repo payloadbay/payloadbay
docker buildx imagetools inspect ghcr.io/payloadbay/payloadbay:0.1.0-alpha.1The image labels carry the source repository, version, revision and the license
AGPL-3.0-only.
Pin a version or a digest
Operators set PAYLOADBAY_IMAGE and PAYLOADBAY_MIGRATOR_IMAGE for
deploy/compose.single.image.yml to the same release, either by version or by
version and digest:
ghcr.io/payloadbay/payloadbay:0.1.0-alpha.1
ghcr.io/payloadbay/payloadbay:0.1.0-alpha.1@sha256:<digest>The digest form cannot change under a running installation, even if a tag were moved. Take the digests from the publish run summary.
Rollback
Images are immutable per version, so a rollback is a redeploy of an earlier one.
- Back up first. Migrations are forward-only and a database that is newer than the image is refused, so an older image works only against a database the older version created or one restored from a backup taken before the upgrade (see upgrades and backup).
- Set
PAYLOADBAY_IMAGEandPAYLOADBAY_MIGRATOR_IMAGEto the earlier version (or its digest) and redeploy. - A bad release stays published for history. Mark the GitHub release as a prerelease or edit its notes with the problem and the version to use instead, and publish a fixed new version. Do not move or delete an image tag that operators may have pinned.
If a floating tag (latest, 1, alpha) points at a bad release, publish the
fixed version; it moves the tag. Pinned operators are unaffected.
One-time maintainer setup
These settings live in GitHub and are not enforced by the repository files:
- Create the
releaseenvironment with the maintainers as required reviewers and deployment tags limited tov*. With a single maintainer, leave "Prevent self-review" off: the person who publishes the release is the only possible approver, and enabling it would block every release. The gate then protects against an accidental or unexpected publish, not against a compromised maintainer account. Add a second reviewer and enable "Prevent self-review" once there is one. - Add a tag ruleset so only maintainers can create or delete
v*tags. - After the first publish, make each GHCR package public once (procedure step 6: set the package public and link it to the repository).
Published candidate acceptance
After an approved merge, download the release-candidate artifact containing images.env, compose.yml and source-manifest.json. From the matching source checkout, run:
Licensing decision record
Status: open. No decision is recorded here. This document lays out options, trade-offs and a recommendation so the maintainer can decide.