Files
xiaozhi-esp32-server/.github/workflows/docker-image.yml
T
baff979ab4 update: 增加docker 统一打包 (#232)
* update: 增加docker 统一打包

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

* update:测试新版镜像自动化编译

---------

Co-authored-by: hrz <1710360675@qq.com>
2025-03-08 21:11:30 +08:00

68 lines
1.8 KiB
YAML

name: Docker Image CI
on:
push:
tags:
- 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0
jobs:
release:
name: Release Docker images
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
id-token: write
issues: write
steps:
- name: Check Disk Space
run: |
df -h
docker system df
- name: Clean up Docker resources
run: |
docker system prune -af
docker builder prune -af
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract version from tag
id: get_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# 构建 xiaozhi-server 镜像
- name: Build and push xiaozhi-server
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-server
push: true
tags: |
ghcr.io/${{ github.repository }}:server_${{ env.VERSION }}
ghcr.io/${{ github.repository }}:server_latest
platforms: linux/amd64,linux/arm64
# 构建 manager-api 镜像
- name: Build and push manager-web
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-web
push: true
tags: |
ghcr.io/${{ github.repository }}:web_${{ env.VERSION }}
ghcr.io/${{ github.repository }}:web_latest
platforms: linux/amd64,linux/arm64