-
Notifications
You must be signed in to change notification settings - Fork 17
162 lines (152 loc) · 11.7 KB
/
build-runbook.yml
File metadata and controls
162 lines (152 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build and Deploy Runbook
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install nbconvert jupyter
- name: Convert notebooks to HTML
run: |
mkdir -p _site
for chapter in ch1 ch2 ch3 ch4; do
if [ -d "$chapter" ]; then
mkdir -p "_site/$chapter"
for notebook in "$chapter"/*.ipynb; do
if [ -f "$notebook" ]; then
jupyter nbconvert --to html --template lab "$notebook" --output-dir "_site/$chapter"
fi
done
fi
done
- name: Copy images and assets
run: |
cp -r ch3/milvus_image_search_data _site/ch3/ 2>/dev/null || true
cp -r ch4/images _site/ch4/ 2>/dev/null || true
cp -r ch4/tutorial-yaml _site/ch4/ 2>/dev/null || true
cp scripts/custom.css _site/custom.css
- name: Inject custom CSS into HTML files
run: |
for html in $(find _site -name "*.html" -not -name "index.html"); do
depth=$(echo "$html" | tr -cd '/' | wc -c)
prefix=""
for ((i=2; i<depth; i++)); do prefix="../$prefix"; done
sed -i "s|</head>|<link rel=\"stylesheet\" href=\"${prefix}custom.css\"></head>|" "$html"
done
- name: Generate index page
run: |
cat > _site/index.html << 'EOF'
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Milvus Workshop</title>
<style>
:root { --text: #1d1d1f; --text-secondary: #86868b; --bg: #fff; --bg-secondary: #f5f5f7; --accent: #0071e3; --border: #d2d2d7; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.container { max-width: 980px; margin: 0 auto; padding: 0 22px; }
header { text-align: center; padding: 80px 22px 60px; }
header img { width: 64px; margin-bottom: 24px; }
header h1 { font-size: 56px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.07; margin-bottom: 12px; }
header p { font-size: 21px; color: var(--text-secondary); font-weight: 400; }
.chapters { padding-bottom: 80px; }
.chapter { margin-bottom: 48px; }
.chapter h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.lessons { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 12px; overflow: hidden; }
.lesson { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--bg); text-decoration: none; color: var(--text); transition: background 0.2s; }
.lesson:hover { background: var(--bg-secondary); }
.lesson-title { font-size: 17px; font-weight: 400; }
.lang-tag { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 12px; }
.lang-zh { background: #fef3e2; color: #b25000; }
.lang-en { background: #e8f4fd; color: #0066cc; }
.arrow { color: var(--text-secondary); font-size: 20px; margin-left: 12px; }
footer { text-align: center; padding: 40px 22px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; }
footer a { color: var(--accent); text-decoration: none; }
@media (max-width: 734px) {
header h1 { font-size: 32px; }
header p { font-size: 17px; }
.chapter h2 { font-size: 22px; }
}
</style>
</head>
<body>
<header>
<img src="ch4/images/milvus-logo.svg" alt="Milvus" onerror="this.style.display='none'">
<h1>Milvus Workshop</h1>
<p>从入门到应用的向量数据库完整教程</p>
</header>
<div class="container">
<div class="chapters">
<div class="chapter">
<h2>Part 1 · 探索 Milvus</h2>
<div class="lessons">
<a href="ch1/ch1_1.html" class="lesson"><span class="lesson-title">1.1 Milvus 向量数据库概述</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch1/ch1_1_en.html" class="lesson"><span class="lesson-title">1.1 Overview of Milvus Vector Database</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch1/ch1_2.html" class="lesson"><span class="lesson-title">1.2 Milvus 安装实践</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch1/ch1_2_en.html" class="lesson"><span class="lesson-title">1.2 Hands-on Milvus Installation</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch1/ch1_3.html" class="lesson"><span class="lesson-title">1.3 Milvus 核心架构与组件解析</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch1/ch1_3_en.html" class="lesson"><span class="lesson-title">1.3 Analysis of Milvus Core Architecture</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
</div>
</div>
<div class="chapter">
<h2>Part 2 · 基础操作</h2>
<div class="lessons">
<a href="ch2/ch2_1.html" class="lesson"><span class="lesson-title">2.1 连接 Milvus 与 Collection 管理</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_1_en.html" class="lesson"><span class="lesson-title">2.1 Connecting to Milvus and Managing Collections</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_2.html" class="lesson"><span class="lesson-title">2.2 数据插入与管理</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_2_en.html" class="lesson"><span class="lesson-title">2.2 Data Insertion and Management</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_3.html" class="lesson"><span class="lesson-title">2.3 索引构建与管理</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_3_en.html" class="lesson"><span class="lesson-title">2.3 Building and Managing Indexes</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_4.html" class="lesson"><span class="lesson-title">2.4 向量搜索、查询与混合搜索</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch2/ch2_4_en.html" class="lesson"><span class="lesson-title">2.4 Vector Similarity Search, Query, and Hybrid Search</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
</div>
</div>
<div class="chapter">
<h2>Part 3 · 应用实践</h2>
<div class="lessons">
<a href="ch3/ch3_1.html" class="lesson"><span class="lesson-title">3.1 Milvus 在图像搜索中的应用</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_1_en.html" class="lesson"><span class="lesson-title">3.1 Applying Milvus in Image Search</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_2.html" class="lesson"><span class="lesson-title">3.2 Milvus 在 RAG 中的应用</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_2_en.html" class="lesson"><span class="lesson-title">3.2 Applying Milvus in RAG</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_3.html" class="lesson"><span class="lesson-title">3.3 Milvus 在 AI Agent 中的应用</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_3_en.html" class="lesson"><span class="lesson-title">3.3 Applying Milvus in AI Agents</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_4.html" class="lesson"><span class="lesson-title">3.4 Milvus 生态功能概览</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch3/ch3_4_en.html" class="lesson"><span class="lesson-title">3.4 Overview of Milvus Ecosystem Features</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
</div>
</div>
<div class="chapter">
<h2>Part 4 · 进阶实践</h2>
<div class="lessons">
<a href="ch4/ch4_1.html" class="lesson"><span class="lesson-title">4.1 Milvus 可观测性与运维实践</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch4/ch4_1_en.html" class="lesson"><span class="lesson-title">4.1 Hands-on Milvus Observability and Operations</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch4/ch4_2.html" class="lesson"><span class="lesson-title">4.2 VectorDBBench 性能测试实践</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch4/ch4_2_en.html" class="lesson"><span class="lesson-title">4.2 Hands-on Benchmarking with VectorDBBench</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
<a href="ch4/ch4_3.html" class="lesson"><span class="lesson-title">4.3 Milvus 性能调优</span><span><span class="lang-tag lang-zh">中文</span><span class="arrow">›</span></span></a>
<a href="ch4/ch4_3_en.html" class="lesson"><span class="lesson-title">4.3 Milvus Performance Tuning</span><span><span class="lang-tag lang-en">EN</span><span class="arrow">›</span></span></a>
</div>
</div>
</div>
</div>
<footer>Built with <a href="https://milvus.io" target="_blank">Milvus</a></footer>
</body>
</html>
EOF
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: gh-pages