From 8d3438b57fd4a3ecbd5e801634a0bd6dd21307ee Mon Sep 17 00:00:00 2001 From: Edouard Gouilliard Date: Fri, 27 Nov 2026 09:00:09 -0400 Subject: [PATCH] ci(mainloop): build amd64 image to ghcr.io/mainloop-ai/hermes-agent Co-Authored-By: Claude Opus 5.5 --- .github/workflows/mainloop-image.yml | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/mainloop-image.yml diff --git a/.github/workflows/mainloop-image.yml b/.github/workflows/mainloop-image.yml new file mode 100644 index 000000000000..22d76319367b --- /dev/null +++ b/.github/workflows/mainloop-image.yml @@ -0,0 +1,67 @@ +# Mainloop fork: build the stock Dockerfile (slim, linux/amd64 — the k8s TEST nodes are amd64) and push it to +# ghcr.io/mainloop-ai/hermes-agent:sha-. The deployment (mainloop-k8s-platform apps/hermes-agent) pins the digest. +# Upstream's own workflows are disabled in this fork; this is the only one that runs. +name: mainloop-image + +on: + workflow_dispatch: + push: + branches: [main] + +permissions: + contents: read + packages: write + +concurrency: + group: mainloop-image + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-24.04 + timeout-minutes: 90 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Write install stamp + run: | + python3 scripts/write_install_stamp.py --output install-stamp.json \ + --distribution docker --update-mechanism external --source ci --commit "$GITHUB_SHA" + + - name: Free disk space + run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + platforms: linux/amd64 + push: true + build-args: | + HERMES_BOT_DESKTOP=0 + tags: | + ghcr.io/mainloop-ai/hermes-agent:sha-${{ github.sha }} + ghcr.io/mainloop-ai/hermes-agent:main + cache-from: type=gha,scope=mainloop-amd64 + cache-to: type=gha,mode=max,scope=mainloop-amd64 + + - name: Summary + run: | + echo "image: ghcr.io/mainloop-ai/hermes-agent:sha-${GITHUB_SHA}" >> "$GITHUB_STEP_SUMMARY" + echo "digest: ${{ steps.build.outputs.digest }}" >> "$GITHUB_STEP_SUMMARY"