-
-
Notifications
You must be signed in to change notification settings - Fork 866
Chore/update docker pulls metrics #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
evil0119
wants to merge
201
commits into
C4illin:main
from
pi-docket:chore/update-docker-pulls-metrics
Closed
Changes from all commits
Commits
Show all changes
201 commits
Select commit
Hold shift + click to select a range
7632584
ci: add GitHub Actions workflows for upstream sync and release automa…
a9b6524
feat: bundle full conversion dependencies into image
6933f5c
fix: remove Microsoft core fonts to unblock CI build
e792dfe
refine fonts and language support
1aadb69
Revise project description in README.md
evil0119 3330103
feat(i18n): add multi-language UI support with 5 languages
a6770c0
Merge branch 'main' of https://github.com/pi-docket/ConvertX-CN
53b83b4
feat: rebrand to ConvertX-CN, fix TypeScript error, add docs
5c68308
feat: 擴展 i18n 支援 65 種語言 + 完整文件系統
558d638
feat(v0.1.4): Fix i18n imports + Default open registration
8089fa0
feat(v0.1.5): Always-on Registration + Scrollable Language Selector
569c572
fix(ci): resolve all lint errors for GitHub Actions
f675a68
feat(docker): 重組 Docker 架構 v0.1.6
44152ff
fix(ci): 修正 Release workflow 確保 Docker Image 正確發佈
03be03b
fix(auth): 修復遠端部署登入失敗問題 v0.1.7
a0eccf0
fix(libreoffice): PDF 轉 DOCX 修正 (v0.1.8)
a45a049
feat: v0.1.9 - 全頁拖曳上傳 + i18n 修正 + 文件更新
d563682
feat: v0.1.9 - Setup 頁面 i18n + 語言選擇器 UI 修復 + 文件重構
bf8784e
docs: README 重構 - 加入 docker run + 精簡結構
1a8548f
docs: README 重構 + i18n UI 規範 + 文件連結整理
7d10268
docs: 新增線上示範資訊與測試帳號
4f3a93f
docs: 更新快速啟動指引,調整標題格式與內容
d87c032
docs: 更新 JWT_SECRET 範例字串以提供更清晰的指導
2b1bfc1
docs: 更新 JWT_SECRET 說明以提供更清晰的指導
2f22c72
docs: 更新 JWT_SECRET 說明以提供更清晰的指導
0c44b62
docs: 更新 Docker Compose 部分,新增建立專案資料夾的指示
e12f2da
docs: 調整 Docker Compose 部分標題格式以增強可讀性
d038806
docs: 優化全頁拖曳上傳支援,增加防重複檢查機制
e083e5d
feat: Add Rust API Server with REST and GraphQL support
e577658
feat(api): Docker Compose 整合與補充文件 - Docker Compose profiles 支援選用 API …
e5ca364
feat: integrate MinerU document to Markdown converter
f7ebc08
refactor: update MinerU to use tar.gz and mineru CLI
5322f85
feat: 實作全域檔案傳輸機制與 .tar 封裝規範
d943771
feat: add PDFMathTranslate converter for PDF translation with mathema…
1f850dd
feat: 更新 Dockerfile 以預先下載 PDFMathTranslate 所需模型及字型
db5f475
feat: add theme toggle functionality and update localization files
79fc6f7
fix: resolve lint issues (XSS K601, knip unused exports, eslint errors)
893e65d
release: v0.1.10
de11dd5
fix: use script file approach to avoid heredoc parsing issues [remote…
41a7111
feat: 更新 Remote Build workflow 支援 Multi-Arch (amd64/arm64)
4537670
fix: 修復 Tailscale SSH 需互動式登入問題,新增 --ssh 參數與 Smoke Test
ddbc921
fix: 修正 tailscale ssh 語法,提供 ACL 設定說明
a4d5cd1
fix: 簡化 Tailscale SSH 流程,改善 Docker Build 錯誤處理
e651813
fix: 優化 Dockerfile 分段安裝,改善 Multi-Arch Build 穩定性
448011f
fix: 更新 Multi-Arch Docker Build 流程,分離建構與推送步驟
4d2a690
fix: 更新 Dockerfile 版本至 v0.1.10,修正基礎映像為 debian:bookworm,並新增 APT 重試機制以改…
7c4a361
fix: 更新 Tailscale SSH 連線步驟,新增手動網頁驗證提示並設定連線超時
4e07cd5
fix: 修復 bookworm 缺少 dasel 和 resvg 套件的問題
947d189
fix: 修復 resvg ARM64 無預編譯版本問題
cac29bf
fix: 修正 Dockerfile 中 dasel 和 resvg 安裝步驟的縮排問題
2f6c3fc
feat: 根據版本號格式決定是否標記 latest
258313f
fix: 正則表達式支援任意數量的版本數字段
cf8aa32
fix: 移除多餘的空行以改善 YAML 格式
1f800c3
feat: 新增自動生成 Changelog 和 GitHub Release 的步驟
912546a
fix: ENOENT download error for archive-only converters (PDFMathTransl…
2169aa9
style: fix prettier formatting
ffb72c5
chore: update Bun version to 1.3.6 in Dockerfiles
69610d2
feat: 新增遠端服務更新工作流程,透過 Tailscale SSH 更新 Docker 服務
8bb5be2
fix: 修正工作流程名稱格式,移除多餘的 emoji
607ccbb
fix: 修正工作流程名稱格式,移除多餘的文字
0f60f3a
feat: 更新 Dockerfile 版本,新增模型驗證腳本以確保預下載模型完整性
7df88d2
chore: 更新工作流程中的 Node.js 和 Bun 版本,調整依賴項版本
9ba87cf
chore: release v0.1.11
8471dfc
feat: 更新 README.md,強調 ConvertX-CN 的全功能特性與優勢
05c4261
fix: 更新 PDFMathTranslate 描述,強調安全翻譯功能
4189c88
更新 README.md
evil0119 4569b81
更新 README.md
evil0119 a5dcccc
fix: 更新 Dockerfile,修正 huggingface_hub 安裝指令以符合 Debian bookworm 的 PEP 6…
a7ea4e2
Merge branch 'main' of https://github.com/pi-docket/ConvertX-CN
6d4ed58
fix: 更新 PDFMathTranslate 模型下載方式,使用 snapshot_download 避免硬編碼檔名
4ca92e3
release: v0.1.11 - BabelDOC 翻譯引擎與穩定性改進
df0082b
feat: 在 Docker Build & Push 工作流程中新增版本顯示,並修正錯誤處理
11dc518
fix: 更新 MinerU 模型下載邏輯,增加設定檔驗證與錯誤處理
37b56ae
fix: 優化 Dockerfile 中模型下載與快取清理邏輯,減少層差異與空間使用
5ad22e4
fix: 優化 Docker 磁碟清理邏輯,針對大型模型與多架構建置進行強化,減少空間使用
e3406a8
fix: BabelDOC 改用 generate-offline-assets 方式預下載資源
fd674fa
fix: 調整 BabelDOC 資源下載邏輯,簡化重試流程並改善錯誤提示
8820aec
fix: 更新 Docker 映像標籤預設值至 0.1.11.test
a9867ee
feat: add Dockerfile for ConvertX-CN v0.1.11 with pre-downloaded mode…
566ee48
fix: 調整 Dockerfile 中 APT 重試機制與安裝步驟,簡化命令格式
89c121b
fix: 簡化 MinerU 和 PDFMathTranslate 的程式碼,改善錯誤處理與參數傳遞
381de08
Update README with testing notes for features
evil9369 d5c9bfa
feat(ci): add model/headless verification, use --no-ff merge strategy
4ec60bf
fix: 更新 bun.lock 中的依賴版本以提升穩定性和安全性
2f9c418
Merge branch 'main' of https://github.com/pi-docket/ConvertX-CN
b5992a8
fix(inkscape): use xvfb-run for headless execution
26304a2
fix(inkscape): use headless-safe export syntax (--export-type/--expor…
840c215
test(e2e): add End-to-End test suite
a9f6e1d
ci: add E2E tests to release workflow
56161ed
fix: format E2E tests and add helpers to knip ignore
3eec729
feat(ci): 擴展 CI/CD E2E 測試並新增 Mock 測試
443cdaa
refactor(ci): 將 E2E 測試移至服務更新後執行
31088cf
fix: 修正表單標籤結構,將文本包裝在 span 中以改善可讀性
63f0b57
chore(release): bump version to 0.1.12
0bc2241
ci: 優化 workflow timeout 和新增手動觸發
cb8ee29
fix: 修正 PDFMathTranslate 模型路徑,確保預下載到 babeldoc cache 目錄
9fc7217
fix: 完善 runtime 離線支援
0d0c002
fix: Inkscape GTK 錯誤 - 使用 xvfb-run 包裝
e084d68
fix: 增強 headless 環境支援
3457311
refactor: 整理環境變數
e327345
feat: add comprehensive E2E tests with Docker workflow
a2512bf
fix: 修復 lint 錯誤和代碼格式化
bed996e
fix: 修正工作流程中的翻譯測試條件和環境變數預設值
bcaddc2
chore: release v0.1.13 - 翻譯測試使用免費服務並修復測試
b3b382d
fix: 修復 CI/CD E2E 測試工作流程
da856d8
feat(i18n): add multilingual support with translations for English, J…
f24eec0
fix: 更新釋出工作流程中的標籤描述為 v0.1.13,並優化工具版本檢查邏輯
a06df23
feat: 新增 OCRmyPDF 轉換引擎 (v0.1.14)
a1761b7
fix: 修復 pdfOcr.ts 未使用變數的 eslint 錯誤
c2d3d13
fix: 修復行尾格式(CRLF → LF)
a3311b2
Initial plan
Copilot c12333f
Merge pull request #1 from pi-docket/copilot/fix-document-path-errors
evil0119 9995dfb
Initial plan
Copilot b247732
Merge pull request #2 from pi-docket/copilot/fix-e2e-test-path
evil0119 9507cbf
Initial plan
Copilot 572ef9f
Merge pull request #3 from pi-docket/copilot/update-file-paths
evil0119 3f1a5e0
Add comprehensive documentation for ConvertX-CN deployment and config…
034cc44
Merge branch 'main' of https://github.com/pi-docket/ConvertX-CN
006256c
Update MinerU description in overview document
evil9369 5a2aac1
Refactor documentation structure: migrate and consolidate multiple fi…
23e9b4a
Merge branch 'main' of https://github.com/pi-docket/ConvertX-CN
b2eb66b
更新轉換器文檔:新增 4 種轉換器,修正格式與描述,擴充輸入輸出格式詳情
c2ad11d
更新轉換器文檔:擴充輸入輸出格式詳情,修正格式與描述
47968f6
更新轉換器文檔:擴充輸入輸出格式詳情,新增多種格式分類
80ab233
Add comprehensive format integrity tests for various converters
2a28e40
fix: 使用 xvfb-run 解決 GUI 工具在 headless 環境卡住問題
ef3bf66
feat: 新增 deark 引擎支援解包/解析多種格式
9b4ecad
更新轉換器文檔:調整內建內容格式,增強可讀性
737e925
fix(deark): 合併格式類別,UI 只顯示單一 extract 選項
a4489f4
feat: add OCR language extension configuration and documentation
f6b4562
fix: 調整 entrypoint 格式並修正測試檔案的空格問題
8a84caa
Refactor Docker Compose examples and documentation
6f8ef58
fix: 修復 Tools & Model Verification 超時問題
699fca4
Update account label translations across multiple languages to "Setti…
2b584dc
fix: 修復 E2E 測試 - 添加 xvfb-run server-args 和改進錯誤處理
d1b81fc
fix: 修復 Tools & Model Verification 超時問題
cb0ea8b
fix: add xauth package for xvfb-run support
0755ff7
fix: 重構 E2E 測試 - 使用 Xvfb 替代 xvfb-run 解決 docker exec 環境問題
87bd318
fix: 重構 E2E 測試 - 使用直接工具調用模擬真實用戶操作
944fe18
Add unit tests for PDF Packager converter functionality
506340e
fix: 更新 site.webmanifest 和 base.tsx,新增多語言支持及應用元數據
1b8cae3
feat: 新增 Lite 版 v0.1.15-lite
73f2bfd
fix: 修復 ARM64 上 endesive 編譯問題
d235ba7
fix: 修復 Dockerfile.lite ARM64 build 問題
dd0bb2a
fix: 完全移除 Lite 版 build-time endesive,改用 runtime 憑證初始化
da2c53f
fix: 分開處理 GHCR 和 Docker Hub manifest 推送,避免跨 registry 400 錯誤
ca2246d
chore: release v0.1.15 - Lite 版 Docker Image 與基礎架構優化
9526d3e
docs: 更新 README 版本說明為三版本(Lite/一般版/Full)
99a9934
docs: 更新 README,新增 Lite 版 Docker 映像大小顯示及版本特性比較
ee7c1da
docs: 新增線上示範連結至 README
27ffdee
fix: Docker image size and add download retry mechanism
cc8df3c
fix: shell syntax for strict model validation in Dockerfile
d3aa8e5
fix: 修正 Dockerfile 中的輸出格式,統一縮排以提高可讀性
2d28665
fix: 修復 ONNX 模型下載(使用 huggingface_hub 支援 xet 格式)
f2c5997
fix: use huggingface_hub for ONNX download and add CACHE_BUST
3a7c049
fix: 修正字型檔案驗證邏輯,確保檔案存在及大小符合要求
4b0f77a
fix: 預存字型檔案於儲存庫,避免 build 時下載失敗
0f5bf46
fix: 新增 CACHE_BUST 參數以強制重新執行模型下載層,改善下載穩定性
81b8200
fix: 預存 ONNX 模型於儲存庫,避免 build 時下載失敗
910250c
fix: MinerU 安裝增加重試機制和備用方法
688e30a
fix: 增加 MinerU 安裝重試等待時間,改善安裝穩定性
2d6ae47
更新 README.md
evil0119 f743010
fix: 修復 MinerU 安裝失敗問題,使用 uv pip install(官方推薦方式)
0b1ecb7
fix(docker): 拆分 RUN 指令,移除 pipx fallback,修復 MinerU 安裝
b23d42a
fix(docker): 修復三個關鍵問題
367e0d3
feat: 完全離線化 Dockerfile v0.1.16
b0d6aea
feat: 新增完整的 Dockerfile,優化安裝流程與依賴管理
d03d084
fix: 添加 --break-system-packages 修復 uv pip install
e43649b
fix: add python3-dev for pykcs11 and fix indentation
55b0f51
refactor(docker): 完整重構 Dockerfile v0.1.16
8867eef
chore: 更新 Dockerfile 版本至 v0.1.17
e862cb6
docs: add Dockerfile refactoring documentation v0.1.17
a9b1fc5
fix: revert to v0.1.16, remove incorrect documentation
906f112
fix(docker): replace python3 -c with heredoc scripts to fix Indentati…
d38505f
feat: 更新 robots.txt、base.tsx 和 sitemap.xml,增強 SEO 設定與多語言支援
11d7512
fix: 更新磁碟清理步驟以釋放更多空間並優化 Docker 建置
caecb2e
新增錯誤排查與支援文件,提供常見問題解決方案;新增開發與貢獻指南,說明專案結構與開發流程;新增授權說明文件,詳述AGPL-3.0授權條款及…
394dcbe
Refactor documentation for improved clarity and consistency
7f74d18
chore: 移除授權部分內容,簡化 README 文件
1eaf5e4
refactor: 重構釋放工作流程,分開構建 AMD64 和 ARM64 映像以優化磁碟空間使用
a62a531
fix: 修復 release workflow job 依賴 + prettier 格式修正
6e36d35
fix: 添加 job timeout 和優化 buildx 設定避免無限卡住
e69b2c5
fix: 移除 timeout 限制,添加上傳完成訊息
b8025f3
fix: 添加構建進度提示訊息(exporting layers = 上傳中)
367f2b4
fix: 更激進的磁碟清理 + BuildKit GC 設定
18e97ec
feat: 改用 CPU-only MinerU,大幅減少 image 大小(~3-5GB)
23d8868
chore: bump version to v0.1.17 (CPU-only build)
cd4c1e8
docs: add v0.1.17 changelog and update Dockerfile.full version
4db68fe
fix: add disk cleanup to verify-image job for large image pull
25e12e8
fix: 移除多餘空行以清理 release.yml 檔案
f083a14
fix: use --lang-out instead of -l for babeldoc (ambiguous option)
174eabe
fix: update MinerU -m parameter from 'pipeline' to 'auto' (MinerU 2.7+)
1173d50
fix: 修正 release.yml 檔案中的格式問題
6d948b0
feat: implement automatic format inference service with candidate gen…
fcc9e36
feat: 更新推斷模組以使用 search token 進行格式推斷,並新增格式搜尋字詞詞庫
257ec9e
feat: 新增 Docker Pulls 歷史記錄工作流程,定期抓取並生成 SVG 圖表
34123c8
feat: 新增 Docker 採用歷史記錄區塊,顯示 Docker Pulls 歷史圖表
a6b5901
feat: 更新 Docker Pulls 歷史記錄工作流程,改善 CSV 檔案處理及 SVG 圖表生成邏輯
d9ff841
feat: 更新 Docker Pulls 歷史記錄工作流程,改用 Pull Request 方式提交更新
c074aa9
chore(metrics): update docker pull history
evil0119 d1dbab7
Merge branch 'C4illin:main' into chore/update-docker-pulls-metrics
evil0119 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.2.2 | ||
| 1.3.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| name: Upstream Sync Report | ||
| about: Auto-generated report for upstream sync | ||
| title: '🔄 Upstream Sync: {{ date | date("YYYY-MM-DD") }}' | ||
| labels: upstream-sync, automated | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ## 🔄 Upstream 自動同步報告 | ||
|
|
||
| **同步日期:** {{ date }} | ||
| **新 Commits:** {{ commit_count }} | ||
|
|
||
| ### 📝 變更摘要 | ||
|
|
||
| ``` | ||
| {{ commits_list }} | ||
| ``` | ||
|
|
||
| ### 🐳 Docker Image | ||
|
|
||
| - **Tag:** `upstream-{{ date_tag }}` | ||
| - **Smoke Test:** {{ smoke_test_status }} | ||
|
|
||
| ### ⏳ 後續動作 | ||
|
|
||
| - [ ] 檢視變更內容 | ||
| - [ ] 確認 smoke test 結果 | ||
| - [ ] 決定是否 merge 到 main | ||
|
|
||
| --- | ||
|
|
||
| _此 Issue 由 GitHub Actions 自動建立_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,280 @@ | ||
| # 🔄 Upstream 自動同步機制 | ||
|
|
||
| 本專案實作了完整的 upstream 自動同步、變更追蹤與 smoke test 機制。 | ||
|
|
||
| ## 📋 目錄 | ||
|
|
||
| - [功能概述](#功能概述) | ||
| - [工作流程圖](#工作流程圖) | ||
| - [Workflow 說明](#workflow-說明) | ||
| - [Smoke Test 內容](#smoke-test-內容) | ||
| - [設定說明](#設定說明) | ||
| - [手動操作](#手動操作) | ||
|
|
||
| --- | ||
|
|
||
| ## 功能概述 | ||
|
|
||
| ### 1️⃣ 自動同步 Upstream | ||
|
|
||
| | 功能 | 說明 | | ||
| | ---------- | ---------------------------- | | ||
| | 觸發方式 | 每 6 小時自動檢查 / 手動觸發 | | ||
| | 同步目標 | `dev` 分支 | | ||
| | Merge 策略 | 自動 merge(無衝突時) | | ||
| | 衝突處理 | 自動建立 GitHub Issue 通知 | | ||
|
|
||
| ### 2️⃣ 變更摘要 | ||
|
|
||
| 同步完成後自動產生: | ||
|
|
||
| - ✅ GitHub Issue(詳細變更記錄) | ||
| - ✅ `upstream-changelog.md`(累積變更歷史) | ||
| - ✅ GitHub Actions Summary(快速查看) | ||
|
|
||
| ### 3️⃣ Smoke Test | ||
|
|
||
| | 測試項目 | 內容 | 時間限制 | | ||
| | -------------- | -------------------------------------- | ------------- | | ||
| | Container 啟動 | 驗證 image 可正常啟動 | 60s | | ||
| | 工具檢查 | libreoffice, pandoc, ffmpeg, tesseract | 30s | | ||
| | 最小轉換 | txt → pdf | 60s | | ||
| | API 端點 | healthcheck, root | 10s | | ||
| | **總計** | | **< 10 分鐘** | | ||
|
|
||
| --- | ||
|
|
||
| ## 工作流程圖 | ||
|
|
||
| ``` | ||
| ┌─────────────────────────────────────────────────────────────────────────┐ | ||
| │ Upstream 自動同步流程 │ | ||
| └─────────────────────────────────────────────────────────────────────────┘ | ||
|
|
||
| ┌──────────────┐ | ||
| │ Upstream │ | ||
| │ (C4illin/ │ | ||
| │ ConvertX) │ | ||
| └──────┬───────┘ | ||
| │ | ||
| │ 每 6 小時檢查 | ||
| ▼ | ||
| ┌──────────────┐ 無更新 ┌──────────────┐ | ||
| │ 檢查是否有 │ ─────────────► │ 結束 │ | ||
| │ 新 commits │ └──────────────┘ | ||
| └──────┬───────┘ | ||
| │ 有更新 | ||
| ▼ | ||
| ┌──────────────┐ 衝突 ┌──────────────┐ | ||
| │ 自動 Merge │ ─────────────► │ 建立 Issue │ | ||
| │ 到 dev 分支 │ │ 需手動處理 │ | ||
| └──────┬───────┘ └──────────────┘ | ||
| │ 成功 | ||
| ▼ | ||
| ┌──────────────┐ | ||
| │ 產生變更摘要 │ | ||
| │ • Issue │ | ||
| │ • Changelog │ | ||
| └──────┬───────┘ | ||
| │ | ||
| ▼ | ||
| ┌──────────────┐ | ||
| │ Push 到 dev │ | ||
| └──────┬───────┘ | ||
| │ | ||
| │ 觸發 upstream-sync.yml | ||
| ▼ | ||
| ┌──────────────┐ | ||
| │ Build 測試 │ | ||
| │ Image (amd64)│ | ||
| └──────┬───────┘ | ||
| │ | ||
| ▼ | ||
| ┌──────────────────────────────────────────────────┐ | ||
| │ Smoke Test │ | ||
| │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ | ||
| │ │ Container │ │ 工具 │ │ 轉換 │ │ | ||
| │ │ 啟動 │ │ 檢查 │ │ 測試 │ │ | ||
| │ └─────┬──────┘ └─────┬──────┘ └─────┬──────┘ │ | ||
| │ │ │ │ │ | ||
| │ └──────────────┼──────────────┘ │ | ||
| │ │ │ | ||
| └───────────────────────┼──────────────────────────┘ | ||
| │ | ||
| ┌─────────────┴─────────────┐ | ||
| │ │ | ||
| ▼ ▼ | ||
| ┌────────────┐ ┌────────────┐ | ||
| │ ✅ 通過 │ │ ❌ 失敗 │ | ||
| └─────┬──────┘ └─────┬──────┘ | ||
| │ │ | ||
| ▼ ▼ | ||
| ┌────────────┐ ┌────────────┐ | ||
| │ Build 並 │ │ Workflow │ | ||
| │ Push 到 │ │ 失敗 │ | ||
| │ Docker Hub │ │ (不發布) │ | ||
| └─────┬──────┘ └────────────┘ | ||
| │ | ||
| ▼ | ||
| ┌────────────────────────┐ | ||
| │ upstream-YYYYMMDD tag │ | ||
| │ ❌ 不更新 latest │ | ||
| │ ❌ 不打 semver tag │ | ||
| └────────────────────────┘ | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Workflow 說明 | ||
|
|
||
| ### `auto-upstream-sync.yml` | ||
|
|
||
| **用途:** 自動檢測並同步 upstream 更新 | ||
|
|
||
| **觸發條件:** | ||
|
|
||
| - ⏰ 每 6 小時自動執行 | ||
| - 🖱️ 手動觸發 | ||
|
|
||
| **主要步驟:** | ||
|
|
||
| 1. Fetch upstream 最新程式碼 | ||
| 2. 檢查是否有新 commits | ||
| 3. 自動 merge 到 `dev` 分支 | ||
| 4. 產生變更摘要(Issue + Changelog) | ||
| 5. Push 到 `dev` | ||
|
|
||
| ### `upstream-sync.yml` | ||
|
|
||
| **用途:** 當 `dev` 分支有 push 時,執行 build + smoke test | ||
|
|
||
| **觸發條件:** | ||
|
|
||
| - 📦 `dev` 分支有 push | ||
|
|
||
| **主要步驟:** | ||
|
|
||
| 1. Build 測試用 image(僅 amd64,加速測試) | ||
| 2. 執行 Smoke Test(10 分鐘內) | ||
| 3. 測試通過後 build multi-arch image | ||
| 4. Push 到 Docker Hub(tag: `upstream-YYYYMMDD`) | ||
|
|
||
| --- | ||
|
|
||
| ## Smoke Test 內容 | ||
|
|
||
| ### Test 1: Container 啟動測試 | ||
|
|
||
| ```bash | ||
| # 啟動 container 並等待 healthcheck 回應 | ||
| docker run -d --name convertx-test $IMAGE | ||
| curl http://localhost:3000/healthcheck | ||
| ``` | ||
|
|
||
| ### Test 2: 關鍵工具檢查 | ||
|
|
||
| ```bash | ||
| # 必須通過(任一失敗則整體失敗) | ||
| libreoffice --version | ||
| pandoc --version | ||
| ffmpeg -version | ||
| tesseract --version | ||
| ``` | ||
|
|
||
| ### Test 3: 最小轉換測試 | ||
|
|
||
| ```bash | ||
| # txt → pdf 轉換測試 | ||
| echo "test" > test.txt | ||
| libreoffice --headless --convert-to pdf test.txt | ||
| ``` | ||
|
|
||
| ### Test 4: API 端點檢查 | ||
|
|
||
| ```bash | ||
| # 確認服務正常運作 | ||
| curl http://localhost:3000/healthcheck | ||
| curl http://localhost:3000/ | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 設定說明 | ||
|
|
||
| ### 必要的 GitHub Secrets | ||
|
|
||
| 在 Repository Settings → Secrets and variables → Actions 中設定: | ||
|
|
||
| | Secret 名稱 | 說明 | | ||
| | -------------------- | ----------------------- | | ||
| | `DOCKERHUB_USERNAME` | Docker Hub 帳號 | | ||
| | `DOCKERHUB_TOKEN` | Docker Hub Access Token | | ||
|
|
||
| ### 分支保護規則 | ||
|
|
||
| 建議設定: | ||
|
|
||
| **`main` 分支:** | ||
|
|
||
| - ✅ Require pull request before merging | ||
| - ✅ Require status checks to pass | ||
| - ❌ Allow force pushes | ||
|
|
||
| **`dev` 分支:** | ||
|
|
||
| - ✅ Allow direct pushes (for automation) | ||
|
|
||
| --- | ||
|
|
||
| ## 手動操作 | ||
|
|
||
| ### 手動觸發同步 | ||
|
|
||
| 1. 前往 Actions → Auto Upstream Sync | ||
| 2. 點選 "Run workflow" | ||
| 3. 可選擇「強制同步」 | ||
|
|
||
| ### 手動處理 Merge 衝突 | ||
|
|
||
| 當自動同步發生衝突時: | ||
|
|
||
| ```bash | ||
| # 1. 切換到 dev 分支 | ||
| git checkout dev | ||
|
|
||
| # 2. 添加 upstream remote(如果還沒有) | ||
| git remote add upstream https://github.com/C4illin/ConvertX.git | ||
|
|
||
| # 3. Fetch upstream | ||
| git fetch upstream main | ||
|
|
||
| # 4. Merge upstream | ||
| git merge upstream/main | ||
|
|
||
| # 5. 解決衝突 | ||
| # ... 編輯衝突的檔案 ... | ||
|
|
||
| # 6. 提交並 push | ||
| git add . | ||
| git commit -m "Resolve merge conflicts with upstream" | ||
| git push origin dev | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## ⚠️ 注意事項 | ||
|
|
||
| 1. **不會自動更新 `latest` tag** - 需要手動發布正式版本 | ||
| 2. **不會自動打 semver tag** - 需要手動建立 release | ||
| 3. **`main` 分支不會被自動修改** - 只有 `dev` 會自動同步 | ||
| 4. **Smoke test 失敗時不會發布 image** - 確保品質 | ||
|
|
||
| --- | ||
|
|
||
| ## 📊 Docker Image Tag 規則 | ||
|
|
||
| | Tag 格式 | 說明 | 自動/手動 | | ||
| | ------------------- | ---------------------------------- | --------- | | ||
| | `upstream-YYYYMMDD` | Upstream 同步版(經過 smoke test) | 自動 | | ||
| | `vX.Y.Z` | 正式版本 | 手動 | | ||
| | `latest` | 最新穩定版 | 手動 | | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Smoke test docs curl localhost without publishing container port, so host curl will not reach the container.
Prompt for AI agents