fix(ci): reduce Docker Actions cost without weakening PR gates (#232)

* fix(docker): update workflow to improve Docker image build and push process, add timeout

* fix(licenses): allow Apache-2.0 WITH LLVM-exception
This commit is contained in:
Will Sarg 2026-02-15 18:15:38 -05:00 committed by GitHub
parent a04716d86c
commit 28ec4ae826
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 76 additions and 53 deletions

View file

@ -6,6 +6,16 @@ on:
tags: ["v*"] tags: ["v*"]
pull_request: pull_request:
branches: [main] branches: [main]
paths:
- "Dockerfile"
- "docker-compose.yml"
- "dev/docker-compose.yml"
- "dev/sandbox/**"
- ".github/workflows/docker.yml"
concurrency:
group: docker-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
@ -15,10 +25,10 @@ jobs:
build-and-push: build-and-push:
name: Build and Push Docker Image name: Build and Push Docker Image
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 25
permissions: permissions:
contents: read contents: read
packages: write packages: write
continue-on-error: true # Don't block PRs on Docker build failures
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -48,19 +58,31 @@ jobs:
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}} type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image - name: Build and push Docker image (push/tag)
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
- name: Build smoke image (PR only)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: zeroclaw-pr-smoke:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
platforms: linux/amd64
- name: Verify image (PR only) - name: Verify image (PR only)
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
run: | run: |
docker build -t zeroclaw-test . docker run --rm zeroclaw-pr-smoke:latest --version
docker run --rm zeroclaw-test --version

View file

@ -10,6 +10,7 @@ yanked = "warn"
allow = [ allow = [
"MIT", "MIT",
"Apache-2.0", "Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSD-2-Clause", "BSD-2-Clause",
"BSD-3-Clause", "BSD-3-Clause",
"ISC", "ISC",