Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Docker Hub

on:
push:
branches:
- master
- main
tags:
- 'v*'
pull_request:
branches:
- master
- main
workflow_dispatch:

env:
REGISTRY: docker.io # 修改点1: 指定 Docker Hub 注册表
IMAGE_NAME: ${{ github.repository }} # 镜像名称,会被 username/repository 覆盖

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # 对于 Docker Hub 不需要这个权限,但保留无害

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }} # 修改点2: 使用 Docker Hub 用户名
password: ${{ secrets.DOCKER_PASSWORD }} # 修改点3: 使用 Docker Hub 密码

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
# 修改点4: 镜像名称格式调整为 Docker Hub 格式
images: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix={{branch}}-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ github.sha }}
8 changes: 4 additions & 4 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
full_hash=abcd1afb74ad6ec5702fa46547faabf50a63e366
short_hash=abcd1af
message=Merge pull request #291 from Dongmayyys/fix/thinking-budget-level-conflict
date=2026-01-17 16:00:44 +0800
full_hash=de7e9dc39d37b5b2282f80a3f2852fc3217395ff
short_hash=de7e9dc
message=Merge branch 'su-kaka:master' into master
date=2026-01-17 17:43:15 +0800