From 8db75033c845caead889e7551aa7e32b9cda7372 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 4 Sep 2026 17:37:36 +0100 Subject: [PATCH] Build and publish a helix-builder image Mirrors the existing relay, data-api and simulator jobs against the builder.Dockerfile that was already in the tree. Co-Authored-By: Claude Opus 5 (1M context) (cherry picked from commit 670c45a4fbb6a6dc04b231890d86b35729d872f2) --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95e992f41..e6957fd1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,3 +135,44 @@ jobs: ghcr.io/${{ github.repository_owner }}/helix-simulator:${{ env.IMAGE_NAME }} cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/helix-simulator:buildcache cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/helix-simulator:buildcache,mode=max + + build-builder: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set IMAGE_NAME + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + BRANCH=$(echo "${{ github.head_ref }}" | tr '[:upper:]' '[:lower:]' | tr '/' '-') + SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) + IMAGE_NAME="${BRANCH}_${SHORT_SHA}" + else + REF_BRANCH=$(echo "${{ github.ref_name }}" | tr '[:upper:]' '[:lower:]' | tr '/' '-') + IMAGE_NAME="${REF_BRANCH}" + fi + echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + file: ./builder.Dockerfile + tags: | + ghcr.io/${{ github.repository_owner }}/helix-builder:${{ env.IMAGE_NAME }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/helix-builder:buildcache + cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/helix-builder:buildcache,mode=max