Skip to content

Commit c95e97c

Browse files
barckcodeclaude
andcommitted
feat: initial marketplace structure with smart CI pipeline
Set up the repository for building custom AgentCrew agent images. The pipeline detects which image directories changed and only builds those. Supports multi-arch (amd64/arm64), manual triggers for specific images or full rebuilds, and auto-rebuilds all images when VERSION changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit c95e97c

4 files changed

Lines changed: 156 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build & Publish Images
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- 'README.md'
8+
- 'LICENSE'
9+
- '.gitignore'
10+
workflow_dispatch:
11+
inputs:
12+
image:
13+
description: 'Specific image directory to build (leave empty to build all)'
14+
required: false
15+
type: string
16+
17+
jobs:
18+
detect:
19+
name: Detect changed images
20+
runs-on: ubuntu-latest
21+
outputs:
22+
matrix: ${{ steps.changes.outputs.matrix }}
23+
has_images: ${{ steps.changes.outputs.has_images }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Determine which images to build
30+
id: changes
31+
run: |
32+
if [[ -n "${{ inputs.image }}" ]]; then
33+
# Manual trigger: specific image
34+
if [[ ! -f "${{ inputs.image }}/Dockerfile" ]]; then
35+
echo "::error::No Dockerfile found in ${{ inputs.image }}/"
36+
exit 1
37+
fi
38+
dirs='["${{ inputs.image }}"]'
39+
40+
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
41+
# Manual trigger without input: build all
42+
dirs=$(find . -maxdepth 2 -name Dockerfile -exec dirname {} \; \
43+
| sed 's|^./||' | sort | jq -R . | jq -s -c .)
44+
45+
else
46+
# Push event: check what changed
47+
prev_commit="${{ github.event.before }}"
48+
49+
# Handle first push (no previous commit)
50+
if [[ "$prev_commit" == "0000000000000000000000000000000000000000" ]]; then
51+
dirs=$(find . -maxdepth 2 -name Dockerfile -exec dirname {} \; \
52+
| sed 's|^./||' | sort | jq -R . | jq -s -c .)
53+
else
54+
# If VERSION changed, rebuild everything
55+
if git diff --name-only "$prev_commit" HEAD | grep -q '^VERSION$'; then
56+
dirs=$(find . -maxdepth 2 -name Dockerfile -exec dirname {} \; \
57+
| sed 's|^./||' | sort | jq -R . | jq -s -c .)
58+
else
59+
# Only build directories that changed
60+
dirs=$(git diff --name-only "$prev_commit" HEAD \
61+
| grep '/' | cut -d'/' -f1 | sort -u \
62+
| while read -r dir; do
63+
[[ -f "$dir/Dockerfile" ]] && echo "$dir"
64+
done | jq -R . | jq -s -c .)
65+
fi
66+
fi
67+
fi
68+
69+
if [[ "$dirs" == "[]" || "$dirs" == "null" || -z "$dirs" ]]; then
70+
echo "has_images=false" >> "$GITHUB_OUTPUT"
71+
echo "matrix=[]" >> "$GITHUB_OUTPUT"
72+
else
73+
echo "has_images=true" >> "$GITHUB_OUTPUT"
74+
echo "matrix=$dirs" >> "$GITHUB_OUTPUT"
75+
fi
76+
77+
echo "Images to build: $dirs"
78+
79+
build:
80+
name: Build ${{ matrix.image }}
81+
needs: detect
82+
if: needs.detect.outputs.has_images == 'true'
83+
runs-on: ubuntu-latest
84+
permissions:
85+
contents: read
86+
packages: write
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
image: ${{ fromJson(needs.detect.outputs.matrix) }}
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Read version
95+
id: version
96+
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
97+
98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v3
100+
101+
- name: Set up Docker Buildx
102+
uses: docker/setup-buildx-action@v3
103+
104+
- name: Login to GHCR
105+
uses: docker/login-action@v3
106+
with:
107+
registry: ghcr.io
108+
username: ${{ github.actor }}
109+
password: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Build and push
112+
uses: docker/build-push-action@v6
113+
with:
114+
context: ${{ matrix.image }}
115+
platforms: linux/amd64,linux/arm64
116+
push: true
117+
tags: |
118+
ghcr.io/helmcode/agentcrew-${{ matrix.image }}:${{ steps.version.outputs.version }}
119+
ghcr.io/helmcode/agentcrew-${{ matrix.image }}:latest
120+
labels: |
121+
org.opencontainers.image.source=https://github.com/helmcode/agent_crew_marketplace
122+
org.opencontainers.image.description=AgentCrew marketplace image - ${{ matrix.image }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
*.log

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AgentCrew Marketplace
2+
3+
Pre-built custom agent images for [AgentCrew](https://github.com/helmcode/agent_crew).
4+
5+
Each directory contains a `Dockerfile` that extends the official AgentCrew agent base images with additional tools and dependencies for specific use cases.
6+
7+
## Usage
8+
9+
Set the **Custom Agent Image** field when creating or editing a team in the AgentCrew UI:
10+
11+
```
12+
ghcr.io/helmcode/agentcrew-<image-name>:latest
13+
```
14+
15+
## Available Images
16+
17+
| Image | Base | Description |
18+
|-------|------|-------------|
19+
| *Coming soon* | | |
20+
21+
## Building Custom Images
22+
23+
See the [Custom Agent Images](https://agentcrew.sh/docs/configuration#custom-agent-images) documentation.
24+
25+
## Contributing
26+
27+
1. Create a new directory with a descriptive name
28+
2. Add a `Dockerfile` extending one of the base images:
29+
- `ghcr.io/helmcode/agent_crew_agent:latest` (Claude Code)
30+
- `ghcr.io/helmcode/agent_crew_opencode_agent:latest` (OpenCode)
31+
3. Push to `main` — only the changed directory will be built and published

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)