添加工作流
This commit is contained in:
parent
461a0bad66
commit
03620c68a6
71
.gitea/workflows/build-docker-images.yml
Normal file
71
.gitea/workflows/build-docker-images.yml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: Docker Image Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: '宝塔版本'
|
||||||
|
required: true
|
||||||
|
default: '9.5.0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-multiarch:
|
||||||
|
name: Build and Push Multi-Arch Docker Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build AMD64 Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: false
|
||||||
|
tags: |
|
||||||
|
ldxw/btpanel:latest-amd64
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }}-amd64
|
||||||
|
|
||||||
|
- name: Build ARM64 Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./arm64/Dockerfile
|
||||||
|
platforms: linux/arm64
|
||||||
|
push: false
|
||||||
|
tags: |
|
||||||
|
ldxw/btpanel:latest-arm64
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }}-arm64
|
||||||
|
|
||||||
|
- name: Create and push multi-arch manifest
|
||||||
|
run: |
|
||||||
|
docker manifest create \
|
||||||
|
ldxw/btpanel:latest \
|
||||||
|
ldxw/btpanel:latest-amd64 \
|
||||||
|
ldxw/btpanel:latest-arm64
|
||||||
|
docker manifest annotate \
|
||||||
|
ldxw/btpanel:latest \
|
||||||
|
ldxw/btpanel:latest-arm64 \
|
||||||
|
--os linux --arch arm64
|
||||||
|
docker manifest push ldxw/btpanel:latest
|
||||||
|
|
||||||
|
docker manifest create \
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }} \
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }}-amd64 \
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }}-arm64
|
||||||
|
docker manifest annotate \
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }} \
|
||||||
|
ldxw/btpanel:${{ github.event.inputs.version }}-arm64 \
|
||||||
|
--os linux --arch arm64
|
||||||
|
docker manifest push ldxw/btpanel:${{ github.event.inputs.version }}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user