```
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 1s

docs(.gitignore/README/QUICKSTART): 更新文档和忽略配置

- 添加IDE配置、日志和数据文件到.gitignore
- 重构QUICKSTART.md,提供Docker Compose和本地开发两种部署方式
- 更新README.md,优化项目介绍和架构说明
- 移除旧的agent.py和backend.py文件
```
This commit is contained in:
2026-04-13 23:57:16 +08:00
parent bf27398cc9
commit 22cc9b1096
20 changed files with 714 additions and 481 deletions

View File

@@ -0,0 +1,61 @@
name: 构建并部署 AI Agent 服务
on:
push:
branches: [ main, master ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 设置 Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: 缓存 pip 依赖
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirement.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 安装 Python 依赖 (仅用于验证)
run: pip install -r requirement.txt
- name: 准备环境变量文件
run: |
cat > .env << EOF
ZHIPUAI_API_KEY=${{ secrets.ZHIPUAI_API_KEY }}
VLLM_LOCAL_KEY=${{ secrets.VLLM_LOCAL_KEY }}
EOF
- name: 重新构建并启动前后端服务(不影响数据库)
run: docker compose up -d --build backend frontend
- name: 健康检查
run: |
echo "等待后端服务启动..."
sleep 15
for i in {1..10}; do
if curl -f http://localhost:8001/ > /dev/null 2>&1; then
echo "✅ 后端服务正常"
exit 0
fi
echo "等待中... ($i/10)"
sleep 5
done
echo "❌ 后端服务未就绪,查看日志:"
docker compose logs backend --tail 50
exit 1
- name: 清理无用的 Docker 资源
run: docker system prune -f
- name: 显示运行状态
run: docker compose ps