Skip to content

Commit 8e441c7

Browse files
authored
Merge pull request #36 from docker/cm/mcp-gh-action-init
Add GH action for mcp image pushes
2 parents bc34de1 + 4a16e0d commit 8e441c7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/mcp_images.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build MCP Images
2+
on:
3+
repository_dispatch:
4+
types: [build-mcp-images]
5+
6+
jobs:
7+
build-mcp-images:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
with:
13+
ref: ${{ github.event.client_payload.ref }}
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
- name: Login to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: dockerpublicbot
20+
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
21+
- name: Build MCP Images
22+
run: >
23+
top_level_folder=$(pwd)
24+
for folder in src/*; do
25+
# If folder does not contain Dockerfile, skip
26+
if [ ! -f "$folder/Dockerfile" ]; then
27+
continue
28+
fi
29+
# If folder has pyproject.toml
30+
if [ -f "$folder/pyproject.toml" ]; then
31+
cd $folder
32+
docker buildx build --builder cloud-ai-labs
33+
--platform linux/amd64,linux/arm64
34+
--tag dockerpublicbot/mcp-$foldername:${{ github.event.client_payload.release_tag }}
35+
--push .
36+
cd $top_level_folder
37+
else
38+
foldername=$(basename $folder)
39+
docker buildx build --builder cloud-ai-labs
40+
--platform linux/amd64,linux/arm64
41+
--tag dockerpublicbot/mcp-$foldername:${{ github.event.client_payload.release_tag }}
42+
--file $folder/Dockerfile
43+
--push .
44+
fi
45+
done

0 commit comments

Comments
 (0)