Skip to content

feat(v3.145.0): MUTAGEN residual → 0 (multi-pass normalize + live-att… #1199

feat(v3.145.0): MUTAGEN residual → 0 (multi-pass normalize + live-att…

feat(v3.145.0): MUTAGEN residual → 0 (multi-pass normalize + live-att… #1199

Workflow file for this run

name: Publish Docker image to GHCR
# Builds + publishes the Mneme Docker image to GitHub Container Registry
# on every release tag (v*) and on every push to main (as `:edge`).
#
# Image name: ghcr.io/patsa2561-art/mneme-ai
# Tags: v0.32.0 (full), 0.32.0 (no v), 0.32 (minor), 0 (major),
# latest (= newest stable tag), edge (= main HEAD)
#
# The Dockerfile installs `mneme-ai` from npm — there is no waiting on
# this workflow before users can `docker pull`. Once the workflow lands,
# the image is in place; the npm publish in `release.yml` is the
# upstream dependency for the version-tagged builds.
# v2.132.0 — RUNNER-LOAD REDUCTION: build+push per RELEASE (tags) + on demand,
# NOT on every main commit. The per-commit `:edge` build saturated the free
# concurrent-job budget and left the important Pages deploy stuck `queued`
# (then cancelled by the next push → red X). A per-release image is the right
# cadence; use workflow_dispatch for an ad-hoc edge build.
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Wait for npm publish to settle on tags
if: startsWith(github.ref, 'refs/tags/v')
run: |
# When a v* tag is pushed, the release workflow publishes to npm
# in parallel. The Docker build pulls `mneme-ai` from npm, so
# we give the npm publish ~2 minutes of headroom before our
# `npm install mneme-ai` step in the Dockerfile.
sleep 120
- name: Compute image tags
id: tags
run: |
set -euo pipefail
IMAGE="ghcr.io/${{ github.repository }}"
IMAGE_LOWER=$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]')
TAGS=""
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
MAJOR="${VERSION%%.*}"
MINOR="${VERSION%.*}"
TAGS="$IMAGE_LOWER:$VERSION,$IMAGE_LOWER:$MINOR,$IMAGE_LOWER:$MAJOR,$IMAGE_LOWER:latest"
else
TAGS="$IMAGE_LOWER:edge"
fi
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
echo "image=$IMAGE_LOWER" >> "$GITHUB_OUTPUT"
- name: Build + push (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test
run: |
set -euo pipefail
IMG="${{ steps.tags.outputs.image }}:${GITHUB_REF##*/}"
IMG="${IMG/refs\/heads\//edge-}"
IMG="${IMG/refs\/tags\/v/}"
# Pull the freshly-pushed image and run --help.
docker pull "${{ steps.tags.outputs.image }}:edge" 2>/dev/null \
|| docker pull "${{ steps.tags.outputs.image }}:latest"
docker run --rm "${{ steps.tags.outputs.image }}:edge" --help \
2>/dev/null \
|| docker run --rm "${{ steps.tags.outputs.image }}:latest" --help