feat:修复github action

This commit is contained in:
MatrixSeven
2025-08-28 19:49:56 +08:00
parent 57c5fa7687
commit 17a44c866d
3 changed files with 59 additions and 313 deletions

View File

@@ -1,5 +1,5 @@
name: 🐳 Build and Push Docker Image
name: 🐳 Build and Push Docker Image (AMD64)
on:
# 手动触发
@@ -15,11 +15,6 @@ on:
required: true
default: true
type: boolean
build_multiarch:
description: '构建多架构镜像 (amd64 + arm64)'
required: true
default: true
type: boolean
# 推送标签时触发
push:
@@ -47,10 +42,6 @@ jobs:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🚀 Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: 🏷️ Extract metadata
id: meta
@@ -69,7 +60,6 @@ jobs:
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
driver-opts: |
network=host
buildkitd-flags: |
@@ -83,16 +73,10 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: 🏗️ Determine build platforms
- name: 🏗️ Set build platform
id: platforms
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.build_multiarch }}" == "true" ]]; then
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "push" ]]; then
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
else
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
fi
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
- name: 🐳 Build and push Docker image
uses: docker/build-push-action@v5