Skip to content

CI: Automate multi-arch container image build and push to GHCR #31

Closed

Description

@pdettori

Summary

Add a GitHub Actions workflow to build and push the serverless-harness container image to ghcr.io/kagenti/serverless-harness on push to main, version tags (v*), and manual dispatch. Must be multi-arch (linux/amd64,linux/arm64) using Docker Buildx, matching the pattern used in kagenti/kagenti and kagenti/kagenti-operator.

Context

Currently the image is built locally only (dev.local/serverless-harness:local) and kind-loaded for development. There is no CI automation. The Dockerfile exists at the repo root and builds @sh/knative-server — a two-stage Node.js 22 Alpine image (~667MB).

Reference Implementations

Repo Workflow Registry path
kagenti/kagenti .github/workflows/build.yaml ghcr.io/kagenti/kagenti/<image>
kagenti/kagenti-operator .github/workflows/release.yml ghcr.io/kagenti/kagenti-operator/<image>

Both use:

  • docker/setup-buildx-action
  • docker/login-action with ghcr.io + GITHUB_TOKEN
  • docker/metadata-action for tag computation
  • docker/build-push-action with platforms: linux/amd64,linux/arm64
  • GitHub Actions cache (type=gha)

Tagging Strategy (match operator pattern)

Trigger Tags
Push to main main-<short-sha>, latest
Version tag v* semver (e.g. 1.2.3), latest
workflow_dispatch latest

Build Considerations

  1. Submodule checkout required — pi-fork/ is a git submodule. Use actions/checkout with submodules: recursive.
  2. Build order — The Dockerfile already handles pi-fork build order internally (ai → agent → tui → coding-agent before pnpm workspace install). No external pre-step needed.
  3. Native deps on ARM — The image uses node:22-alpine with native canvas/cairo libs. Alpine apk packages are multi-arch, so the existing Dockerfile should work on both platforms without changes. Verify in the first CI run.
  4. No matrix needed — Single image (serverless-harness), unlike kagenti's multi-image matrix.

Acceptance Criteria

  • Workflow file at .github/workflows/build.yaml
  • Triggers: push to main, push of v* tags, workflow_dispatch
  • Builds multi-arch: linux/amd64,linux/arm64
  • Pushes to ghcr.io/kagenti/serverless-harness
  • Tags follow the strategy above (sha-prefix on main, semver on tags, latest)
  • Uses GitHub Actions build cache (type=gha)
  • Checks out submodules recursively
  • Workflow passes on current main branch

Non-Goals

  • Helm chart packaging (no chart in this repo yet)
  • Image cleanup workflow (add later when SHA images accumulate)
  • Smoke test in CI (local smoke tests are manual; add separately)

Files to Reference

  • Dockerfile — the existing two-stage build
  • .dockerignore — already configured
  • pnpm-workspace.yaml — workspace package layout
  • deploy/knative/service.yaml — shows current dev.local/serverless-harness:local reference (will remain for local dev; CI image is for cluster deployments)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions