更新 Docker 构建流程,简化 Harbor 镜像推送步骤,直接使用 docker build/push 进行 amd64 构建

This commit is contained in:
2025-06-09 06:33:24 +08:00
parent 717bacc734
commit 9de70a8104

View File

@@ -133,11 +133,13 @@ jobs:
imagename="$url/$namespace:$TAG"
echo "$token" | docker login "$url" -u "$user" --password-stdin
# 如果是 Harbor只推送 amd64
if [[ "$url" == "reg.liteyuki.org" ]]; then
docker buildx build --platform linux/amd64 -f ./Dockerfile -t "$imagename" --push .
# 只构建 amd64直接用 docker build/push
docker build -t "$imagename" -f ./Dockerfile .
docker push "$imagename"
if [[ "${{ steps.version.outputs.nightly }}" == "false" ]]; then
docker buildx build --platform linux/amd64 -f ./Dockerfile -t "$url/$namespace:latest" --push .
docker tag "$imagename" "$url/$namespace:latest"
docker push "$url/$namespace:latest"
fi
else
docker buildx build --platform linux/amd64,linux/arm64 -f ./Dockerfile -t "$imagename" --push .