1+ name : Docker Build and Publish Base Image
2+
3+ on :
4+ workflow_dispatch :
5+
6+ env :
7+ DOCKER_HUB_USERNAME : ifuryst
8+ ALIYUN_REGISTRY : registry.ap-southeast-1.aliyuncs.com/mcp-ecosystem
9+ BUILDX_NO_DEFAULT_ATTESTATIONS : 1
10+
11+ jobs :
12+ build-and-push :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+
22+ - name : Set up Docker Buildx
23+ uses : docker/setup-buildx-action@v3
24+ with :
25+ platforms : linux/amd64,linux/arm64
26+
27+ - name : Login to Docker Hub
28+ uses : docker/login-action@v3
29+ with :
30+ username : ${{ env.DOCKER_HUB_USERNAME }}
31+ password : ${{ secrets.DOCKER_HUB_TOKEN }}
32+
33+ - name : Login to GitHub Container Registry
34+ uses : docker/login-action@v3
35+ with :
36+ registry : ghcr.io
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Login to Aliyun Container Registry
41+ uses : docker/login-action@v3
42+ with :
43+ registry : ${{ env.ALIYUN_REGISTRY }}
44+ username : ${{ secrets.ALIYUN_USERNAME }}
45+ password : ${{ secrets.ALIYUN_PASSWORD }}
46+
47+ - name : Build and push base image
48+ uses : docker/build-push-action@v5
49+ with :
50+ context : .
51+ file : deploy/docker/base/Dockerfile
52+ push : true
53+ platforms : linux/amd64,linux/arm64
54+ cache-from : type=gha
55+ cache-to : type=gha,mode=max
56+ build-args : |
57+ PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
58+ UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/
59+ npm_config_registry=https://registry.npmmirror.com
60+ tags : |
61+ ${{ env.DOCKER_HUB_USERNAME }}/mcp-gateway-base:latest
62+ ghcr.io/${{ github.repository }}/base:latest
63+ ${{ env.ALIYUN_REGISTRY }}/mcp-gateway-base:latest
0 commit comments