Skip to content

Build Images

Build the release images when code merges (ADR-598).

Every push to main (except the release commit) builds the images whose inputs changed, natively per architecture, and tags every image sha-<12 char commit> so each main commit has a full set. The Release workflow later promotes those exact images instead of building its own.

changes โ”€โ”ฌโ”€โ–บ build-amd64 (ubuntu-latest) โ”€โ” โ””โ”€โ–บ build-arm64 (ubuntu-24.04-arm) โ”€โ”ดโ”€โ–บ index

  • changes: which images' inputs changed since the nearest earlier main commit that has every image's sha- tag (scripts/ci/image_changes.py). It walks first-parent history from the push's "before" commit (up to 20 commits, hence fetch-depth 0), because release commits and dropped queued runs leave commits with no tags.
  • build-*: build the changed images for one platform on a runner of that platform and push them by digest, no tag, no cache.
  • index: join the two platforms into one multi-arch index per rebuilt image and tag it sha-<12>. Unchanged images get the same tag on their index on that earlier commit (a re-tag, no rebuild). Every index is checked to hold exactly linux/amd64 and linux/arm64.

This workflow only pushes unsigned digests and sha- tags. It has no id-token, attestation or cosign access: signing, attesting and version tags stay in the Release workflow behind the prod environment.

Run it by hand (Actions -> Build Images -> Run workflow) to build every image for any branch. A manual run has no previous commit, so it rebuilds everything. So does a push with no fully tagged commit in the walk.

uses: huntridge-labs/argus/.github/workflows/build-images.yml@1.15.2-rc.0

Triggers

  • Push
  • Manual dispatch

Permissions

Scope Access
contents read

Jobs

changes โ€” Which images changed

Runs on: ubuntu-latest ยท Timeout: 10 minutes ยท Condition: ${{ !startsWith(github.event.head_commit.message, 'chore(release):') }}

Steps:

  1. Checkout โ€” actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
  2. Decide which images to build

build-amd64 โ€” Build images (linux/amd64)

Runs on: ubuntu-latest ยท Timeout: 30 minutes ยท Depends on: changes ยท Condition: ${{ needs.changes.outputs.rebuild != '[]' }}

Steps:

  1. Checkout โ€” actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
  2. Log in to GHCR โ€” docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550
  3. Set up Docker Buildx โ€” docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069
  4. Build and push by digest (linux/amd64)

build-arm64 โ€” Build images (linux/arm64)

Runs on: ubuntu-24.04-arm ยท Timeout: 30 minutes ยท Depends on: changes ยท Condition: ${{ needs.changes.outputs.rebuild != '[]' }}

Steps:

  1. Checkout โ€” actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
  2. Log in to GHCR โ€” docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550
  3. Set up Docker Buildx โ€” docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069
  4. Build and push by digest (linux/arm64)

index โ€” Tag images sha-

Runs on: ubuntu-latest ยท Timeout: 10 minutes ยท Depends on: changes, build-amd64, build-arm64 ยท Condition: ${{ !cancelled() && needs.changes.result == 'success' && !contains(needs.*.result, 'failure') }}

Steps:

  1. Checkout โ€” actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
  2. Log in to GHCR โ€” docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550
  3. Create and verify each index