Skip to content

build-mcp-images

build-mcp-images #6

Workflow file for this run

name: Build MCP Images
on:
repository_dispatch:
types: [build-mcp-images]
jobs:
build-mcp-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: modelcontextprotocol/servers
ref: ${{ github.event.client_payload.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERPUBLICBOT_USERNAME }}
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
- name: Build MCP Images
run: |
top_level_folder=$(pwd)
for folder in src/*; do
# If folder does not contain Dockerfile, skip
if [ ! -f "$folder/Dockerfile" ]; then
continue
fi
# If folder has pyproject.toml
if [ -f "$folder/pyproject.toml" ]; then
cd $folder
docker buildx build --builder cloud-ai-labs \
--platform linux/amd64,linux/arm64 \
--tag dockerpublicbot/mcp-$foldername:${{ github.event.client_payload.release_tag }} \
--push .
cd $top_level_folder
else
foldername=$(basename $folder)
docker buildx build --builder cloud-ai-labs \
--platform linux/amd64,linux/arm64 \
--tag dockerpublicbot/mcp-$foldername:${{ github.event.client_payload.release_tag }} \
--file $folder/Dockerfile \
--push .
fi
done