From df0082bfb90b40b413157564255d0a2bdb3366d8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 22 Jan 2026 17:54:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=20Docker=20Build=20&=20Push?= =?UTF-8?q?=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=A8=8B=E4=B8=AD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=89=88=E6=9C=AC=E9=A1=AF=E7=A4=BA=EF=BC=8C=E4=B8=A6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=8C=AF=E8=AA=A4=E8=99=95=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build-remote.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-remote.yml b/.github/workflows/docker-build-remote.yml index 8040574..de6944a 100644 --- a/.github/workflows/docker-build-remote.yml +++ b/.github/workflows/docker-build-remote.yml @@ -306,6 +306,7 @@ jobs: echo "========================================" echo "🔨 開始 Multi-Arch Docker Build" echo "========================================" + echo "版本: v${{ github.event.inputs.image_tag }}" echo "映像名稱: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" # 判斷是否為正式版本(純數字+點號,支援任意段數如 0.1.10 或 0.1.10.1) @@ -399,6 +400,7 @@ jobs: echo "========================================" echo "📤 推送映像到 Docker Hub" echo "========================================" + echo "版本: v${{ github.event.inputs.image_tag }}" echo "映像: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" # 判斷是否為正式版本(純數字+點號,支援任意段數如 0.1.10 或 0.1.10.1) @@ -500,6 +502,7 @@ jobs: echo "========================================" echo "✅ 驗證 Docker Hub 映像" echo "========================================" + echo "版本: v${{ github.event.inputs.image_tag }}" echo "映像: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" echo "" @@ -589,6 +592,8 @@ jobs: echo "✅ Multi-Arch Docker Build & Push 完成!" echo "========================================" echo "" + echo "🏷️ 版本: v${{ github.event.inputs.image_tag }}" + echo "" echo "📦 映像資訊:" echo " - 版本標籤: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" @@ -663,9 +668,11 @@ jobs: # Step 18: 創建 GitHub Release # 說明:為正式版本自動創建 GitHub Release # 注意:不使用 generate_release_notes,改用 body_path 提供完整 changelog + # 注意:如果 Release 已存在會失敗,使用 continue-on-error 跳過 # ======================================== - name: 📦 Create GitHub Release if: ${{ !contains(github.event.inputs.image_tag, 'test') && !contains(github.event.inputs.image_tag, 'dev') && !contains(github.event.inputs.image_tag, 'alpha') && !contains(github.event.inputs.image_tag, 'beta') }} + continue-on-error: true uses: softprops/action-gh-release@v2 with: tag_name: v${{ github.event.inputs.image_tag }} @@ -685,10 +692,14 @@ jobs: echo "========================================" echo "🔄 更新遠端 ConvertX-CN 服務" echo "========================================" + echo "版本: v${{ github.event.inputs.image_tag }}" + echo "" - tailscale ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'REMOTE_EOF' + tailscale ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << REMOTE_EOF set -e + IMAGE_TAG="v${{ github.event.inputs.image_tag }}" + # 1. 進入專案資料夾 cd /home/bioailab/miniconda3/lid/app/convertx-cn @@ -698,7 +709,7 @@ jobs: # 3. 拉取最新映像檔 echo "" - echo "📋 拉取最新映像檔..." + echo "📋 拉取最新映像檔(\${IMAGE_TAG})..." docker compose pull # 4. 重新啟動 @@ -716,7 +727,7 @@ jobs: docker logs convertx-cn --tail=100 echo "" - echo "✅ ConvertX-CN 服務已更新完成" + echo "✅ ConvertX-CN 服務已更新至 \${IMAGE_TAG}" REMOTE_EOF echo "========================================"