mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
ci: 自动构建image
This commit is contained in:
parent
10dc679d7e
commit
2b4f3d80a5
1 changed files with 7 additions and 12 deletions
19
.github/workflows/docker-image.yml
vendored
19
.github/workflows/docker-image.yml
vendored
|
|
@ -2,6 +2,8 @@ name: Docker Image CI
|
|||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # 推送main分支时触发
|
||||
tags:
|
||||
- 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0
|
||||
workflow_dispatch:
|
||||
|
|
@ -9,7 +11,7 @@ on:
|
|||
jobs:
|
||||
release:
|
||||
name: Release Docker images
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ecs-volc
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
|
|
@ -32,13 +34,6 @@ jobs:
|
|||
- 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: |
|
||||
|
|
@ -58,8 +53,8 @@ jobs:
|
|||
file: Dockerfile-server
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IS_VERSION == 'true' && format('ghcr.io/{0}:server_{1},ghcr.io/{0}:server_latest', github.repository, env.VERSION) || format('ghcr.io/{0}:server_latest', github.repository) }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
r-veen.volces.com/vei/public/xiaozhi-server:api
|
||||
platforms: linux/amd64
|
||||
|
||||
# 构建 manager-api 镜像
|
||||
- name: Build and push manager-web
|
||||
|
|
@ -69,5 +64,5 @@ jobs:
|
|||
file: Dockerfile-web
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IS_VERSION == 'true' && format('ghcr.io/{0}:web_{1},ghcr.io/{0}:web_latest', github.repository, env.VERSION) || format('ghcr.io/{0}:web_latest', github.repository) }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
r-veen.volces.com/vei/public/xiaozhi-server:web
|
||||
platforms: linux/amd64
|
||||
Loading…
Reference in a new issue