-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.61 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.61 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
# 可配置变量
PYTHON := python3.12
PIP := pip3
# 虚拟环境
VENV := .venv
ACTIVATE := . $(VENV)/bin/activate
.PHONY: install run build deploy help export
help:
@echo "📋 可用命令:"
@echo ""
@echo " make install 安装开发依赖并激活虚拟环境"
@echo " make crawl 抓取 GitHub Trending"
@echo " make cate 对文档分类"
@echo " make gene 启动文章解析"
@echo " make run 执行 crawl + gene"
@echo " make build 构建静态站点 (zensical build)"
@echo " make deploy 构建并部署到 GitHub Pages"
@echo " make export 从 md 文件导出 URL 到 urls.txt"
@echo " make clean-cache 清理缓存"
@echo ""
install:
@echo "📦 安装开发依赖..."
uv sync
@echo "✅ 依赖安装完成,激活环境:source $(VENV)/bin/activate"
crawl:
@echo "🚀 抓取trending..."
$(ACTIVATE) && uv run python main.py crawl
cate:
@echo "🚀 分类..."
$(ACTIVATE) && uv run python main.py cate
gene:
@echo "🚀 启动解析..."
$(ACTIVATE) && uv run python main.py
run: crawl gene build
@echo "🚀 启动服务run\crawl..."
build:
@echo "🏗️ 构建静态站点..."
$(ACTIVATE) && uv run zensical build
deploy: build
@echo "🚀 部署到 GitHub Pages..."
@cd site && rm -rf .git && git init && git add -A && git commit -m "Deploy to GitHub Pages" && git remote add origin ssh://git@ssh.github.com:443/hjkl01/github-collection.git && git push -f origin HEAD:gh-pages
export:
@echo "📤 导出 URL..."
$(ACTIVATE) && uv run python main.py export
clean-cache:
@echo "🚀 清理缓存..."
rm -rf src/content/docs/00