mirror of
https://gitee.com/fightroad/DicomSCP.git
synced 2025-12-06 10:38:57 +08:00
docker 自动构建脚本
This commit is contained in:
38
.github/workflows/docker-build.yml
vendored
Normal file
38
.github/workflows/docker-build.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Docker Build and Push
|
||||
|
||||
on:
|
||||
workflow_dispatch: # 允许手动触发
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker image tag'
|
||||
required: true
|
||||
default: 'latest'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: |
|
||||
fightroad/dicomscp:${{ github.event.inputs.tag }}
|
||||
fightroad/dicomscp:latest
|
||||
cache-from: type=registry,ref=fightroad/dicomscp:buildcache
|
||||
cache-to: type=registry,ref=fightroad/dicomscp:buildcache,mode=max
|
||||
Reference in New Issue
Block a user