update:优化docker自动编译

This commit is contained in:
hrz 2025-02-22 22:09:12 +08:00
parent 9cd1feb416
commit c0edc8c822

View file

@ -2,8 +2,9 @@ name: Docker Image CI
on: on:
push: push:
branches: [ "main" ] tags:
workflow_dispatch: - 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0
jobs: jobs:
release: release:
name: Release Docker image name: Release Docker image
@ -24,9 +25,9 @@ jobs:
- name: Log in to the GitHub Container Registry - name: Log in to the GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ccr.ccs.tencentyun.com registry: ghcr.io
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }} password: ${{ secrets.TOKEN }}
- name: Extract version from tag - name: Extract version from tag
id: get_version id: get_version
@ -39,5 +40,7 @@ jobs:
with: with:
context: . context: .
push: true push: true
tags: ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64