mirror of
https://github.com/MatrixSeven/file-transfer-go.git
synced 2026-02-15 01:34:46 +08:00
feat:修复github action
This commit is contained in:
22
.github/workflows/docker-publish.yml
vendored
22
.github/workflows/docker-publish.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user