Skip to content

Commit a9b6626

Browse files
committed
ci: add GitHub Actions build pipeline, push images to GHCR
- Add .github/workflows/build.yaml: - Runs go vet + tests on PRs and pushes - Builds all 8 images in parallel matrix on main push - Pushes to ghcr.io/alexsjones/k8sclaw/<image>:latest + :sha - Uses Docker Buildx with GHA layer caching - Update REGISTRY default to ghcr.io/alexsjones/k8sclaw - Add 'make set-images' target to stamp registry/tag into manifests - Update all YAML manifests and Go source to use correct GHCR path - Modernize project icon SVG
1 parent 23d6e65 commit a9b6626

11 files changed

Lines changed: 265 additions & 161 deletions

File tree

.github/workflows/build.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Push Images
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
REGISTRY: ghcr.io/alexsjones/k8sclaw
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
cache: true
26+
27+
- name: Vet
28+
run: go vet ./...
29+
30+
- name: Test
31+
run: go test -race -short ./...
32+
33+
build-and-push:
34+
runs-on: ubuntu-latest
35+
needs: test
36+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
37+
strategy:
38+
matrix:
39+
image:
40+
- controller
41+
- apiserver
42+
- ipc-bridge
43+
- webhook
44+
- channel-telegram
45+
- channel-whatsapp
46+
- channel-discord
47+
- channel-slack
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Log in to GHCR
52+
uses: docker/login-action@v3
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
61+
- name: Extract metadata
62+
id: meta
63+
uses: docker/metadata-action@v5
64+
with:
65+
images: ${{ env.REGISTRY }}/${{ matrix.image }}
66+
tags: |
67+
type=raw,value=latest,enable={{is_default_branch}}
68+
type=sha,prefix=
69+
70+
- name: Build and push
71+
uses: docker/build-push-action@v6
72+
with:
73+
context: .
74+
file: images/${{ matrix.image }}/Dockerfile
75+
push: true
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
cache-from: type=gha
79+
cache-to: type=gha,mode=max

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# K8sClaw Makefile
22
# Kubernetes-native agent orchestration platform
33

4-
# Image registry
5-
REGISTRY ?= ghcr.io/k8sclaw
4+
# Image registry — matches ghcr.io/<owner>/<repo>/<image>
5+
REGISTRY ?= ghcr.io/alexsjones/k8sclaw
66
TAG ?= latest
77

88
# Go parameters
@@ -83,6 +83,14 @@ docker-push: $(addprefix docker-push-,$(IMAGES)) ## Push all Docker images
8383
docker-push-%: ## Push a specific Docker image
8484
docker push $(REGISTRY)/$*:$(TAG)
8585

86+
set-images: ## Stamp REGISTRY/TAG into K8s manifests
87+
cd config/manager && kustomize edit set image \
88+
controller=$(REGISTRY)/controller:$(TAG) \
89+
apiserver=$(REGISTRY)/apiserver:$(TAG)
90+
cd config/webhook && kustomize edit set image \
91+
webhook=$(REGISTRY)/webhook:$(TAG)
92+
@echo "Images set to $(REGISTRY)/*:$(TAG)"
93+
8694
##@ Deployment
8795

8896
install: manifests ## Install CRDs into the K8s cluster

config/manager/manager.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
type: RuntimeDefault
3737
containers:
3838
- name: manager
39-
image: ghcr.io/k8sclaw/controller:latest
39+
image: ghcr.io/alexsjones/k8sclaw/controller:latest
4040
args:
4141
- --leader-elect
4242
- --event-bus-url=nats://nats.k8sclaw-system.svc:4222
@@ -96,7 +96,7 @@ spec:
9696
type: RuntimeDefault
9797
containers:
9898
- name: apiserver
99-
image: ghcr.io/k8sclaw/apiserver:latest
99+
image: ghcr.io/alexsjones/k8sclaw/apiserver:latest
100100
args:
101101
- --event-bus-url=nats://nats.k8sclaw-system.svc:4222
102102
ports:

config/samples/agentrun_sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
maxTokens: 128000
1717
sandbox:
1818
enabled: true
19-
image: ghcr.io/k8sclaw/sandbox:latest
19+
image: ghcr.io/alexsjones/k8sclaw/sandbox:latest
2020
skills:
2121
- code-review
2222
toolPolicy:

config/samples/clawinstance_sample.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ spec:
1414
agents:
1515
default:
1616
model: gpt-4o
17-
image: ghcr.io/k8sclaw/agent-codex:latest
17+
image: ghcr.io/alexsjones/k8sclaw/agent-codex:latest
1818
maxTokens: 128000
1919
sandbox:
2020
enabled: true
21-
image: ghcr.io/k8sclaw/sandbox:latest
21+
image: ghcr.io/alexsjones/k8sclaw/sandbox:latest
2222
resourceLimits:
2323
cpu: "2"
2424
memory: 4Gi

config/samples/clawpolicy_sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
inheritTools: true
3737
sandboxPolicy:
3838
required: false
39-
defaultImage: ghcr.io/k8sclaw/sandbox:latest
39+
defaultImage: ghcr.io/alexsjones/k8sclaw/sandbox:latest
4040
maxCPU: "4"
4141
maxMemory: 8Gi
4242
mountPolicy:

config/webhook/manifests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
type: RuntimeDefault
2626
containers:
2727
- name: webhook
28-
image: ghcr.io/k8sclaw/webhook:latest
28+
image: ghcr.io/alexsjones/k8sclaw/webhook:latest
2929
ports:
3030
- containerPort: 9443
3131
name: webhook

0 commit comments

Comments
 (0)