From 87ddfeade7408be2f7d63fd103e0fdd381598741 Mon Sep 17 00:00:00 2001 From: root <953994191@qq.com> Date: Tue, 14 Apr 2026 00:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 - .env.example | 9 --------- .gitea/workflows/deploy.yml | 37 +++++++++++-------------------------- 3 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 .env.example diff --git a/.env b/.env index 7ac96ac..5a1e63d 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -LOCAL_MODEL_PATH=gemma-4-E2B-it ZHIPUAI_API_KEY=4d568a4367f1442bbc226cc0daf84566.44SsKVWkVIM2Mkeg VLLM_LOCAL_KEY=token-abc123 EOF \ No newline at end of file diff --git a/.env.example b/.env.example deleted file mode 100644 index 5c84b6c..0000000 --- a/.env.example +++ /dev/null @@ -1,9 +0,0 @@ -# AI Agent 环境变量配置模板 -# 复制此文件为 .env 并填入真实的 API Key -LOCAL_MODEL_PATH=gemma-4-E2B-it -# 智谱 AI API Key(必需) -# 获取地址: https://open.bigmodel.cn/ -ZHIPUAI_API_KEY=4d568a4367f1442bbc226cc0daf84566.44SsKVWkVIM2Mkeg - -# vLLM 本地模型 Token(可选,仅使用本地模型时需要) -VLLM_LOCAL_KEY=token-abc123 diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 88d514d..71ab6d7 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -11,34 +11,19 @@ jobs: steps: - name: 检出代码 uses: actions/checkout@v4.1.1 - with: - fetch-depth: 0 - - name: 设置 Python 3.11 - uses: actions/setup-python@v4.7.1 - with: - python-version: '3.11' - - - name: 缓存 pip 依赖 - uses: actions/cache@v3.3.2 - 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: 准备环境变量文件 + - name: 检查 Python 环境 run: | - cat > .env << EOF - ZHIPUAI_API_KEY=${{ secrets.ZHIPUAI_API_KEY }} - VLLM_LOCAL_KEY=${{ secrets.VLLM_LOCAL_KEY }} - EOF + python3 --version + pip3 --version - - name: 重新构建并启动前后端服务(不影响数据库) - run: docker compose up -d --build backend frontend + - name: 构建并启动前后端服务(环境变量注入) + env: + ZHIPUAI_API_KEY: ${{ secrets.ZHIPUAI_API_KEY }} + VLLM_LOCAL_KEY: ${{ secrets.VLLM_LOCAL_KEY }} + run: | + export DOCKER_BUILDKIT=1 + docker compose up -d --build backend frontend - name: 健康检查 run: | @@ -60,4 +45,4 @@ jobs: run: docker system prune -f - name: 显示运行状态 - run: docker compose ps + run: docker compose ps \ No newline at end of file