From f054f66d92ceda551117c4a65cb54e994d0bb4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A3=E5=8D=97=E7=A7=91=E6=8A=80?= Date: Sat, 22 Feb 2025 22:12:02 +0800 Subject: [PATCH] Docker build (#115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update:配置docker自动编译 * update:修改docker编译参数 * update:测试docker编译 * update:优化docker自动编译 --------- Co-authored-by: hrz <1710360675@qq.com> --- .github/workflows/docker-image.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 77e8ce72..b957ee2e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,8 +2,9 @@ name: Docker Image CI on: push: - branches: [ "main" ] - workflow_dispatch: + tags: + - 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0 + jobs: release: name: Release Docker image @@ -24,9 +25,9 @@ jobs: - name: Log in to the GitHub Container Registry uses: docker/login-action@v3 with: - registry: ccr.ccs.tencentyun.com - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.TOKEN }} - name: Extract version from tag id: get_version @@ -39,5 +40,7 @@ jobs: with: context: . 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