Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix(ci): harden the image publish workflow after review

Rufus3b7642274a0e
diff --git a/.github/workflows/release-images.yml b/.github/workflows/release-images.yml
index d851a020..d977575e 100644
--- a/.github/workflows/release-images.yml
+++ b/.github/workflows/release-images.yml
@@ -1,34 +1,49 @@
# Publish the API and UI container images to GitHub Container Registry.
#
-# Every push to main refreshes the rolling `main` tag; pushing a `v*` git tag
-# (e.g. `git tag v0.2.0 && git push origin v0.2.0`) publishes the versioned
-# `X.Y.Z`, `X.Y` and `latest` tags. Both images are built from the same
-# Dockerfiles `make docker` and a platform deploy use, so the published image is
-# the same artifact a local build produces at that commit.
+# Every push to main refreshes the rolling `main` tag; pushing a `vX.Y.Z` git
+# tag (e.g. `git tag v0.2.0 && git push origin v0.2.0`) publishes the versioned
+# `X.Y.Z`, `X.Y` and `latest` tags. Both images are built from the Dockerfiles
+# under docker/ with the repo root as context. Note that `make docker` builds
+# only the API image (compose runs the UI as a dev server), so this workflow
+# is the only thing that builds docker/Dockerfile.ui.
+#
+# Publishing is not gated on ci.yml: the `main` tag is published in parallel
+# with CI, and a tag publishes whatever commit it points at. Tag only commits
+# on main that CI has passed. The two images are separate matrix jobs, so a
+# release is not atomic — if one job fails, the other's tags still exist.
#
# The job is guarded to this repository: the saas fork syncs with
# `git merge upstream/main` and would otherwise run this on every push to its
-# own main, and a third-party fork would try to push under its own account.
-# A fork that wants its own images changes the guard and the image names.
+# own main, and a third-party fork would fail with a 403 pushing to the
+# hardcoded ghcr.io/sentelabsai/* names. A fork that wants its own images
+# changes the guard and the image names.
#
# linux/amd64 only. The API image bakes torch plus two embedding-model caches
# (see docker/Dockerfile); building that under arm64 emulation is impractically
# slow. Multi-arch is a follow-up.
name: Publish images
+# No workflow_dispatch: `type=ref,event=branch` below would publish a tag
+# named after whatever branch it was dispatched from. Re-run a failed run from
+# the Actions UI instead.
on:
push:
branches: [main]
- tags: ["v*"]
- workflow_dispatch:
+ # Semver only. A bare `v*` would accept `v0.2` or `vnext`, which
+ # metadata-action's semver rules ignore, giving a green run that
+ # published no release tags.
+ tags: ["v[0-9]*.[0-9]*.[0-9]*"]
permissions:
contents: read
packages: write
+# Keyed on the commit, not the ref: `git push origin main v0.2.0` delivers a
+# branch push and a tag push for the same SHA, and both write `sha-<short>`.
+# Serialising them keeps that tag pointing at one build. Never cancel a
+# half-pushed release.
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- # Never cancel a half-pushed release.
+ group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: false
jobs:
@@ -75,13 +90,22 @@ jobs:
type=ref,event=branch
type=sha
+ # Layer cache lives in the registry under a `buildcache` tag, not the
+ # Actions cache: the API image's dependency layers (torch and CUDA
+ # wheels, two baked embedding models) run to several GB, and the Actions
+ # cache is 10 GB per repository, so a `type=gha,mode=max` export would
+ # evict itself and the UI's cache on every run.
+ # provenance=false keeps each tag a plain single-platform image; the
+ # default attestation manifest shows up as an `unknown/unknown` row on
+ # the package page.
- uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
push: true
+ provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- cache-from: type=gha,scope=${{ matrix.name }}
- cache-to: type=gha,mode=max,scope=${{ matrix.name }}
+ cache-from: type=registry,ref=${{ matrix.image }}:buildcache
+ cache-to: type=registry,ref=${{ matrix.image }}:buildcache,mode=max
diff --git a/README.md b/README.md
index 43a07cd0..5411b5ae 100644
--- a/README.md
+++ b/README.md
@@ -297,12 +297,13 @@ Versioned images are published to GitHub Container Registry on every release,
so a deployment can pull instead of building:
```bash
-docker pull ghcr.io/sentelabsai/openexecutive-api:0.1.0
-docker pull ghcr.io/sentelabsai/openexecutive-ui:0.1.0
+docker pull ghcr.io/sentelabsai/openexecutive-api:<version>
+docker pull ghcr.io/sentelabsai/openexecutive-ui:<version>
```
Tags: `X.Y.Z` and `X.Y` for a release, `latest` for the newest release, and
-`main` for the current head of `main`. See
+`main` for the current head of `main`. The available versions are listed on
+each package's page under the repository's Packages. See
[docs/deployment.md](docs/deployment.md#images) for how releases are cut.
> **⚠️ Single-instance only**: the scheduler claims rows via `UPDATE … RETURNING`,
diff --git a/docs/deployment.md b/docs/deployment.md
index 750da600..4ae91bea 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -45,27 +45,34 @@ so the UI origin is the only one that *needs* to be public. See [auth.md](auth.m
## Images
[.github/workflows/release-images.yml](../.github/workflows/release-images.yml)
-builds both images from the Dockerfiles above and pushes them to GitHub
-Container Registry. The published image is the same artifact `make docker`
-builds at that commit — nothing is added or configured in CI.
+builds both images from the Dockerfiles above, with the repo root as build
+context, and pushes them to GitHub Container Registry. Nothing is added or
+configured in CI. Note that `make docker` builds only the API image — the
+compose file runs the UI as a `next dev` server — so this workflow is the only
+thing that builds `Dockerfile.ui`.
| Tag | Set by | Meaning |
|---|---|---|
| `X.Y.Z`, `X.Y` | pushing git tag `vX.Y.Z` | A release. Pin deployments to one of these. |
| `latest` | pushing git tag `vX.Y.Z` | The newest release. |
| `main` | every push to `main` | Current head of `main`; not a release. |
-| `sha-<short>` | every push | The exact commit, for tracing an image back to source. |
+| `sha-<short>` | every push | The commit the image was built from. |
+| `buildcache` | every push | BuildKit layer cache. Not an image; ignore it. |
-**Cutting a release** is pushing a tag from a commit on `main` that CI has
-already passed:
+**Cutting a release** is pushing a `vX.Y.Z` tag:
```bash
git tag v0.2.0 && git push origin v0.2.0
```
-The workflow runs on the tag push and publishes the versioned tags. Nothing
-bumps the version strings in `packages/core/pyproject.toml` or
-`packages/ui/package.json` for you; update them in the release commit.
+The workflow runs on the tag push and publishes the versioned tags. It does
+not check CI: it publishes whatever commit the tag points at, and the `main`
+tag is published in parallel with CI on every push, so tag only a commit on
+`main` that CI has passed. The two images are separate jobs, so a release is
+not atomic — if one fails, check the package pages and re-run the failed job
+from the Actions UI. Nothing bumps the version strings in
+`packages/core/pyproject.toml` or `packages/ui/package.json` for you; update
+them in the release commit.
The images are `linux/amd64` only. The API image bakes the embedding models at
build time (see the Dockerfile), which makes an emulated arm64 build