mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 16:01:28 +00:00
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: docker-build-push
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev ]
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: dev
|
|
fetch-depth: 1
|
|
|
|
# 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:
|
|
context: .
|
|
file: Dockerfile
|
|
platforms: |
|
|
linux/386
|
|
linux/amd64
|
|
linux/arm64
|
|
linux/arm/v7
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/shellcrash:latest
|
|
${{ secrets.DOCKERHUB_USERNAME }}/shellcrash:${{ github.ref_name }}
|