feat: add support for manual workflow dispatch and enhance Docker image build process

This commit is contained in:
sunbk201 2024-11-14 00:45:27 +08:00
parent aa5926a606
commit d5c117600d

View File

@ -1,6 +1,7 @@
name: Build and Push Docker Image
on:
workflow_dispatch:
push:
tags:
- 'v*'
@ -26,9 +27,30 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
- name: Build and push Docker latest images
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch'
with:
context: .
push: true
platforms: |
linux/amd64,
linux/arm/v7,
linux/arm64,
linux/386,
linux/mips64le,
linux/mipsle,
linux/riscv64,
windows/amd64,
windows/arm64,
darwin/amd64,
darwin/arm64
tags: ${{ github.repository }}:latest
- name: Build and push Docker images with Release tag
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
context: .
push: true