Revert "feat(deployment): add QEMU setup for cross-platform builds and improve Docker Buildx configuration"

This reverts commit 5a7f39726b.
This commit is contained in:
yuxuanhui
2026-09-25 00:54:12 +08:00
parent 5a7f39726b
commit a3cb6dbacf
4 changed files with 6 additions and 34 deletions
+3 -26
View File
@@ -16,12 +16,6 @@ jobs:
uses: https://github.com/actions/checkout@v4
with:
persist-credentials: false
- name: Set up QEMU for cross-platform builds
uses: https://github.com/docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
# Gitea does not use the GitHub Actions cache backend.
cache-image: false
- name: Build and push to Gitea Packages
shell: bash
env:
@@ -37,31 +31,14 @@ jobs:
: "${REGISTRY_PASSWORD:?Set REGISTRY_PASSWORD}"
registry="${IMAGE_PREFIX%%/*}"
auth_dir=$(mktemp -d)
builder_name=""
cleanup() {
local rc=$?
if [[ -n "$builder_name" ]]; then
docker buildx rm "$builder_name" >/dev/null || true
fi
rm -rf -- "$auth_dir"
exit "$rc"
}
trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
trap 'rm -rf -- "$auth_dir"' EXIT
export DOCKER_CONFIG="$auth_dir"
export BUILDX_CONFIG="$auth_dir/buildx"
printf '%s' "$REGISTRY_PASSWORD" | docker login "$registry" --username "$REGISTRY_USERNAME" --password-stdin
unset REGISTRY_PASSWORD
# Create after selecting the isolated config; do not change the runner's default builder.
builder_name=$(docker buildx create --driver docker-container)
docker info --format 'Build host: {{.OSType}}/{{.Architecture}}'
echo "Target platform: ${BUILD_PLATFORM:-linux/amd64}"
docker buildx inspect "$builder_name" --bootstrap
docker buildx build --builder "$builder_name" --pull --load --platform "${BUILD_PLATFORM:-linux/amd64}" \
docker build --pull --load --platform "${BUILD_PLATFORM:-linux/amd64}" \
--label "org.opencontainers.image.revision=$DEPLOY_TAG" \
-f Dockerfile.backend -t "$IMAGE_PREFIX-backend:$DEPLOY_TAG" .
docker buildx build --builder "$builder_name" --pull --load --platform "${BUILD_PLATFORM:-linux/amd64}" \
docker build --pull --load --platform "${BUILD_PLATFORM:-linux/amd64}" \
--label "org.opencontainers.image.revision=$DEPLOY_TAG" \
-f Dockerfile.frontend -t "$IMAGE_PREFIX-web:$DEPLOY_TAG" .
docker push "$IMAGE_PREFIX-backend:$DEPLOY_TAG"