Skip to content

Modern Docker Management, Designed for Everyone

ci/cd: use static build for agent-next image

Kyle Mendell75f14fda4076
diff --git a/.github/workflows/build-1.0-preview.yml b/.github/workflows/build-1.0-preview.yml
deleted file mode 100644
index a27d487b5..000000000
--- a/.github/workflows/build-1.0-preview.yml
+++ /dev/null
@@ -1,189 +0,0 @@
-name: Build and Publish 1.0 Preview (Manager + Agent)
-
-on:
- push:
- branches:
- - 1.0.0
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- prerelease:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- packages: write
- id-token: write
- attestations: write
-
- env:
- DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane
- AGENT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane-headless
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v5
- with:
- fetch-depth: 1
-
- - name: Lowercase image names
- run: |
- echo "DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME,,}" >> "$GITHUB_ENV"
- echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> "$GITHUB_ENV"
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v4
-
- - name: Setup Node.js
- uses: actions/setup-node@v5
- with:
- node-version: 24
-
- - name: Install frontend dependencies
- run: pnpm -C frontend install --frozen-lockfile
-
- - name: Build frontend
- env:
- NODE_OPTIONS: --max-old-space-size=3072
- run: pnpm -C frontend build
-
- - name: Setup Go
- uses: actions/setup-go@v5
- with:
- go-version-file: backend/go.mod
-
- - name: Build arcane binaries
- run: bash scripts/development/build-binaries.sh --docker
-
- - name: Build agent binaries
- run: bash scripts/development/build-binaries.sh --docker --agent
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
-
- - name: Login to GHCR
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Compute image tags
- id: tags
- run: |
- SHORT_SHA="$(git rev-parse --short HEAD)"
- echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
- echo "IMAGE_STABLE=${DOCKER_IMAGE_NAME}:1.0-preview" >> "$GITHUB_ENV"
- echo "IMAGE_SHA=${DOCKER_IMAGE_NAME}:1.0-preview-${SHORT_SHA}" >> "$GITHUB_ENV"
- echo "AGENT_IMAGE_STABLE=${AGENT_IMAGE_NAME}:1.0-preview" >> "$GITHUB_ENV"
- echo "AGENT_IMAGE_SHA=${AGENT_IMAGE_NAME}:1.0-preview-${SHORT_SHA}" >> "$GITHUB_ENV"
-
- - name: Build and push manager image
- id: build-manager
- uses: docker/build-push-action@v6
- with:
- context: ./
- file: docker/Dockerfile-static
- platforms: linux/amd64,linux/arm64
- push: true
- tags: |
- ${{ env.IMAGE_STABLE }}
- ${{ env.IMAGE_SHA }}
- cache-from: type=gha,scope=preview-manager
- cache-to: type=gha,scope=preview-manager,mode=max
-
- - name: Build and push agent image
- id: build-agent
- uses: docker/build-push-action@v6
- with:
- context: ./
- file: docker/Dockerfile-agent-static
- platforms: linux/amd64,linux/arm64
- push: true
- tags: |
- ${{ env.AGENT_IMAGE_STABLE }}
- ${{ env.AGENT_IMAGE_SHA }}
- cache-from: type=gha,scope=preview-agent
- cache-to: type=gha,scope=preview-agent,mode=max
-
- - name: Attest arcane image
- uses: actions/attest-build-provenance@v2
- with:
- subject-name: '${{ env.DOCKER_IMAGE_NAME }}'
- subject-digest: ${{ steps.build-manager.outputs.digest }}
- push-to-registry: true
-
- - name: Attest agent image
- uses: actions/attest-build-provenance@v2
- with:
- subject-name: '${{ env.AGENT_IMAGE_NAME }}'
- subject-digest: ${{ steps.build-agent.outputs.digest }}
- push-to-registry: true
-
- - name: Compute build timestamp (UTC)
- run: echo "BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_ENV"
-
- - name: Move 1.0-preview tag to this commit
- uses: actions/github-script@v7
- with:
- script: |
- const tag = '1.0-preview';
- const owner = context.repo.owner;
- const repo = context.repo.repo;
-
- try {
- await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` });
- await github.rest.git.updateRef({ owner, repo, ref: `tags/${tag}`, sha: context.sha, force: true });
- core.info(`Updated tag ${tag} to ${context.sha}`);
- } catch (e) {
- if (e.status === 404) {
- await github.rest.git.createRef({ owner, repo, ref: `refs/tags/${tag}`, sha: context.sha });
- core.info(`Created tag ${tag} at ${context.sha}`);
- } else {
- core.setFailed(e.message);
- }
- }
-
- - name: Create/Update GitHub prerelease
- uses: softprops/action-gh-release@v2
- with:
- tag_name: 1.0-preview
- name: Arcane 1.0 Preview
- draft: false
- prerelease: true
- make_latest: false
- target_commitish: ${{ github.sha }}
- body: |
- Arcane 1.0 Preview
-
- Build timestamp (UTC): ${{ env.BUILD_TIMESTAMP }}
-
- Docker images:
- - ${{ env.IMAGE_STABLE }}
- - ${{ env.IMAGE_SHA }}
-
- Agent images:
- - ${{ env.AGENT_IMAGE_STABLE }}
- - ${{ env.AGENT_IMAGE_SHA }}
-
- Digests:
- - Manager: ${{ steps.build-manager.outputs.digest }}
- - Agent: ${{ steps.build-agent.outputs.digest }}
-
- Commit: ${{ github.sha }}
- Branch: ${{ github.ref_name }}
-
- Notes:
- - Pre-release builds are for testing only.
- - Binaries below are builds produced by CI.
- - Not all functions may work on all platforms.
- files: |
- backend/.bin/*
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/build-agent-next.yml b/.github/workflows/build-agent-next.yml
index 6133da9af..f922f7396 100644
--- a/.github/workflows/build-agent-next.yml
+++ b/.github/workflows/build-agent-next.yml
@@ -1,4 +1,4 @@
-name: Build Agent Image
+name: Build Next Image (Agent)
on:
push:
@@ -28,6 +28,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
+ - name: Setup Go
+ uses: actions/setup-go@v5
+ with:
+ go-version-file: backend/go.mod
+
- name: Set DOCKER_IMAGE_NAME
run: |
REPO_OWNER=${{ github.repository_owner }}
@@ -41,12 +46,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Build agent binaries
+ run: bash scripts/development/build-binaries.sh --docker --agent
+
- name: Build and push agent image
id: build-push-image
uses: docker/build-push-action@v6
with:
context: .
- file: docker/Dockerfile-agent
+ file: docker/Dockerfile-agent-static
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:next
diff --git a/.github/workflows/build-next.yml b/.github/workflows/build-next.yml
index 13a811d85..1bb8e44ad 100644
--- a/.github/workflows/build-next.yml
+++ b/.github/workflows/build-next.yml
@@ -1,4 +1,4 @@
-name: Build Next Image
+name: Build Next Image (Manager)
on:
push: