~Docker构建优化

This commit is contained in:
juewuy
2025-12-17 22:00:25 +08:00
parent c6a18a8981
commit aa324029cd
2 changed files with 9 additions and 19 deletions

View File

@@ -1,6 +1,8 @@
name: docker-build-push
name: Build Docker image for ShellCrash
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
@@ -14,25 +16,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
with:
ref: dev
fetch-depth: 1
- name: Read version
id: read_version
run: echo "VERSION=$(cat version)" >> $GITHUB_ENV
# QEMU 支持
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 登录 Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 构建并推送
- name: Build and push (multi-arch)
uses: docker/build-push-action@v6
with:
@@ -46,4 +47,4 @@ jobs:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/shellcrash:latest
${{ secrets.DOCKERHUB_USERNAME }}/shellcrash:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/shellcrash:${{ env.VERSION }}