Skip to Content
Payload Bay
Releases

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.

ItemFormatExample
Git tag and release titlev<major>.<minor>.<patch> or v<major>.<minor>.<patch>-<channel>.<n>, channel alpha, beta or rcv0.1.0-alpha.1
Image tagthe tag without v0.1.0-alpha.1
GitHub releaseprerelease if and only if the tag has a suffixalpha, 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:

ReleaseTags pushed
v0.1.0-alpha.10.1.0-alpha.1, alpha
v0.1.0-beta.20.1.0-beta.2, beta
v1.0.0-rc.11.0.0-rc.1, rc
v1.4.21.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.9 after v2.0.0) does not move latest or 1, 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 nightly image.

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:

  1. builds the linux/amd64 image and loads it locally, never pushing;
  2. starts it with deploy/compose.single.yml and a throwaway PostgreSQL with generated secrets, and waits for the container to report healthy;
  3. runs scripts/release/smoke-single.sh, which requires the setup page to answer 200 and /api/v1/health to answer with a JSON body (200, or 401 for an anonymous caller);
  4. 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)

  1. Merge the change to master and wait for CI on that exact commit to succeed. Confirm the changelog, known limitations and any breaking change.
  2. 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), tag v0.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 --prerelease for a stable version).
  3. Publishing the release starts the workflow. The validate job requires the tag format, a matching prerelease flag, a tagged commit that is on master, and a successful CI validation check run for that commit. In parallel the build-test job builds and smoke-tests the images without pushing.
  4. The publish job then waits for approval of the protected release environment. Review the run and approve it in the run page ("Review deployments"). Nothing is pushed before this approval.
  5. After approval the job builds both images for linux/amd64 and linux/arm64, pushes the tags above with a BuildKit SBOM and mode=max provenance, adds a GitHub build-provenance attestation for each digest, and writes the pushed digests to the run summary.
  6. The first time only: GHCR creates the package as private. In the organization's packages, open each of payloadbay and payloadbay-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.
  7. 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.1

The 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.

  1. 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).
  2. Set PAYLOADBAY_IMAGE and PAYLOADBAY_MIGRATOR_IMAGE to the earlier version (or its digest) and redeploy.
  3. 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:

  1. Create the release environment with the maintainers as required reviewers and deployment tags limited to v*. 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.
  2. Add a tag ruleset so only maintainers can create or delete v* tags.
  3. After the first publish, make each GHCR package public once (procedure step 6: set the package public and link it to the repository).
Edit this page

On this page