This repository has been archived on 2026-03-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
knowledge-base/.gitea/workflows/ci.yml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 40: mapping values are not allowed in this context

41 lines
1.2 KiB
YAML

name: Knowledge Base Deploy
on:
push:
branches:
- main
env:
DEPLOY_HOST: micecola.top
DEPLOY_USER: root
TEST_DIR: /www/wwwroot/kb-web-test/zhangqing
PROD_DIR: /www/wwwroot/kb-web/zhangqing
jobs:
# ==================== 测试环境部署(自动) ====================
deploy-test:
runs-on: ubuntu-latest
steps:
- name: Deploy to test environment
uses: appleboy/ssh-action@v1
with:
host: ${{ env.DEPLOY_HOST }}
username: ${{ env.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
# 直接部署 - 不备份
rm -rf ${{ env.TEST_DIR }}
git clone --depth 1 -b main ssh://gitea-external/starmen1265/knowledge-base.git ${{ env.TEST_DIR }}
# 删除 .git 目录
rm -rf ${{ env.TEST_DIR }}/.git
# 设置权限
chown -R www:www ${{ env.TEST_DIR }}
echo "✅ 测试环境知识库部署完成"
echo "文件数: $(find ${{ env.TEST_DIR }} -type f | wc -l)"
- name: Notify
run: echo "✅ 测试环境: http://${{ env.DEPLOY_HOST }}:8081"