ci: 添加 Epic UI 构建和部署工作流

- 新增 CI/CD 工作流文件,实现前端项目的自动构建和部署
- 支持 main、master 和 develop 分支的自动构建- 包含代码检出、环境安装、依赖管理、项目构建等步骤
- 实现构建产物的自动部署和 Docker 容器重启
This commit is contained in:
hu xiaotong
2025-07-08 13:20:47 +08:00
parent 72013fe803
commit 23bef2484e
2 changed files with 35 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ jobs:
# 直接挂载到指定的宿主机路径
- /opt/gitea-runner-cache:/opt/hostedtoolcache
# 挂载生产环境目录
- /opt/1panel/apps/openresty/openresty/www/sites/epic7:/opt/prod
- /opt/1panel/apps/openresty/openresty/www/sites/epic7/index:/opt/prod
steps:
- name: 检出代码
shell: bash
@@ -273,7 +273,25 @@ jobs:
# 设置权限
chmod -R 755 "$PROD_DIR"
# 强制同步文件系统
echo "🔄 同步文件系统..."
sync
echo "✅ 部署完成"
echo "📁 生产环境目录: $PROD_DIR (对应宿主机: /opt/1panel/apps/openresty/openresty/www/sites/epic7)"
echo "📁 生产环境目录: $PROD_DIR (对应宿主机: /opt/1panel/apps/openresty/openresty/www/sites/epic7/index)"
echo "📦 部署的文件:"
ls -la "$PROD_DIR"
ls -la "$PROD_DIR"
# 验证部署结果
echo "🔍 验证部署结果..."
echo "📋 文件数量: $(find "$PROD_DIR" -type f | wc -l)"
echo "📋 目录数量: $(find "$PROD_DIR" -type d | wc -l)"
echo "📋 总大小: $(du -sh "$PROD_DIR" | cut -f1)"
# 检查关键文件
if [ -f "$PROD_DIR/index.html" ]; then
echo "✅ index.html 存在"
echo "📋 index.html 大小: $(ls -lh "$PROD_DIR/index.html" | awk '{print $5}')"
else
echo "❌ index.html 不存在"
fi