-
Notifications
You must be signed in to change notification settings - Fork 40
94 lines (82 loc) · 2.73 KB
/
Copy pathpublish-images.yaml
File metadata and controls
94 lines (82 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: publish-images
# Builds the orchestrator and agent container images on every push to main
# and publishes them to GHCR (public). Deploy scripts pull these instead of
# building from source on the target VM, which cuts end-to-end Lightsail
# deploy time from ~12 minutes to ~2-3 minutes.
#
# Packages land at:
# ghcr.io/stainlu/openclaw-managed-agents-orchestrator:{latest,sha-<sha>}
# ghcr.io/stainlu/openclaw-managed-agents-agent:{latest,sha-<sha>}
#
# After the first successful publish, make both packages public in the GitHub
# UI (user profile -> Packages -> each package -> Package settings ->
# Change visibility -> Public). Required so deploy scripts can pull without
# auth.
on:
push:
branches: [main]
paths:
- "Dockerfile.orchestrator"
- "Dockerfile.runtime"
- "package.json"
- "pnpm-lock.yaml"
- "tsconfig.json"
- "src/**"
- "docker/**"
- ".github/workflows/publish-images.yaml"
workflow_dispatch:
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
OWNER: stainlu
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: orchestrator
dockerfile: Dockerfile.orchestrator
image: openclaw-managed-agents-orchestrator
- name: agent
dockerfile: Dockerfile.runtime
image: openclaw-managed-agents-agent
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=sha,prefix=sha-
type=ref,event=branch
- name: Build and push ${{ matrix.name }}
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,scope=${{ matrix.name }},mode=max
provenance: false
- name: Image digest
run: echo "${{ matrix.name }} → ${{ steps.meta.outputs.tags }}"