perf(ci): 使用 Kubernetes 内部 Service 加速镜像推送
Some checks failed
Deploy / Build and Push Images (push) Failing after 45s
Deploy / Deploy to Knative (push) Has been skipped

- 使用 gitea-http.infra.svc.cluster.local:3000 替代外部域名
- 避免流量经过外部网络,提升推送速度
- 配置 BuildKit 支持 HTTP insecure registry
- 同一集群内部通信,延迟更低
This commit is contained in:
Charile Zhou
2026-01-22 22:07:22 +08:00
parent 6323f6b361
commit af159b6b4f

View File

@@ -6,7 +6,8 @@ on:
- main
env:
REGISTRY: gitea.tegical.world
# 集群内部使用 Service 名称,避免外部网络跳转
REGISTRY: gitea-http.infra.svc.cluster.local:3000
IMAGE_PREFIX: tegical/seclusion
jobs:
@@ -19,8 +20,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx with insecure registry
run: |
# 创建 BuildKit 配置文件
mkdir -p ~/.docker
cat > ~/.docker/buildkitd.toml <<EOF
[registry."${{ env.REGISTRY }}"]
http = true
insecure = true
EOF
# 创建并使用新的 builder
docker buildx create --use --name insecure-builder \
--driver docker-container \
--driver-opt network=host \
--config ~/.docker/buildkitd.toml
- name: Generate image tag
id: meta