mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 08:12:21 +00:00
CI: cache Docker builds in workflows
This commit is contained in:
8
.github/workflows/docker-release.yml
vendored
8
.github/workflows/docker-release.yml
vendored
@@ -109,6 +109,8 @@ jobs:
|
||||
labels: ${{ steps.labels.outputs.value }}
|
||||
provenance: false
|
||||
push: true
|
||||
cache-from: type=gha,scope=docker-release-amd64
|
||||
cache-to: type=gha,mode=max,scope=docker-release-amd64
|
||||
|
||||
- name: Build and push amd64 slim image
|
||||
id: build-slim
|
||||
@@ -122,6 +124,8 @@ jobs:
|
||||
labels: ${{ steps.labels.outputs.value }}
|
||||
provenance: false
|
||||
push: true
|
||||
cache-from: type=gha,scope=docker-release-amd64
|
||||
cache-to: type=gha,mode=max,scope=docker-release-amd64
|
||||
|
||||
# Build arm64 images (default + slim share the build stage cache)
|
||||
build-arm64:
|
||||
@@ -210,6 +214,8 @@ jobs:
|
||||
labels: ${{ steps.labels.outputs.value }}
|
||||
provenance: false
|
||||
push: true
|
||||
cache-from: type=gha,scope=docker-release-arm64
|
||||
cache-to: type=gha,mode=max,scope=docker-release-arm64
|
||||
|
||||
- name: Build and push arm64 slim image
|
||||
id: build-slim
|
||||
@@ -223,6 +229,8 @@ jobs:
|
||||
labels: ${{ steps.labels.outputs.value }}
|
||||
provenance: false
|
||||
push: true
|
||||
cache-from: type=gha,scope=docker-release-arm64
|
||||
cache-to: type=gha,mode=max,scope=docker-release-arm64
|
||||
|
||||
# Create multi-platform manifests
|
||||
create-manifest:
|
||||
|
||||
28
.github/workflows/sandbox-common-smoke.yml
vendored
28
.github/workflows/sandbox-common-smoke.yml
vendored
@@ -34,7 +34,12 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
docker build -t openclaw-sandbox-smoke-base:bookworm-slim - <<'EOF'
|
||||
docker buildx build \
|
||||
--load \
|
||||
--tag openclaw-sandbox-smoke-base:bookworm-slim \
|
||||
--cache-from type=gha,scope=sandbox-common-smoke-base \
|
||||
--cache-to type=gha,mode=max,scope=sandbox-common-smoke-base \
|
||||
- <<'EOF'
|
||||
FROM debian:bookworm-slim
|
||||
RUN useradd --create-home --shell /bin/bash sandbox
|
||||
USER sandbox
|
||||
@@ -46,14 +51,19 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
BASE_IMAGE="openclaw-sandbox-smoke-base:bookworm-slim" \
|
||||
TARGET_IMAGE="openclaw-sandbox-common-smoke:bookworm-slim" \
|
||||
PACKAGES="ca-certificates" \
|
||||
INSTALL_PNPM=0 \
|
||||
INSTALL_BUN=0 \
|
||||
INSTALL_BREW=0 \
|
||||
FINAL_USER=sandbox \
|
||||
scripts/sandbox-common-setup.sh
|
||||
docker buildx build \
|
||||
--load \
|
||||
--tag openclaw-sandbox-common-smoke:bookworm-slim \
|
||||
--file Dockerfile.sandbox-common \
|
||||
--build-arg BASE_IMAGE=openclaw-sandbox-smoke-base:bookworm-slim \
|
||||
--build-arg PACKAGES=ca-certificates \
|
||||
--build-arg INSTALL_PNPM=0 \
|
||||
--build-arg INSTALL_BUN=0 \
|
||||
--build-arg INSTALL_BREW=0 \
|
||||
--build-arg FINAL_USER=sandbox \
|
||||
--cache-from type=gha,scope=sandbox-common-smoke \
|
||||
--cache-to type=gha,mode=max,scope=sandbox-common-smoke \
|
||||
.
|
||||
|
||||
u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
|
||||
test "$u" = "sandbox"
|
||||
|
||||
Reference in New Issue
Block a user