From bc69a6c0e01696b3f8f0a8c5137f77a60dd5cb3c Mon Sep 17 00:00:00 2001 From: hu xiaotong <416314413@163.com> Date: Wed, 9 Jul 2025 10:28:46 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Epic=20UI=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=92=8C=E9=83=A8=E7=BD=B2=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 CI/CD 工作流文件,实现前端项目的自动构建和部署 - 支持 main、master 和 develop 分支的自动构建- 包含代码检出、环境安装、依赖管理、项目构建等步骤 - 实现构建产物的自动部署和 Docker 容器重启 --- .drone.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f9796ce --- /dev/null +++ b/.drone.yml @@ -0,0 +1,49 @@ +kind: pipeline +type: docker +name: default + +trigger: + event: + - manual + +steps: + - name: build + image: node:18-alpine + commands: + - echo "=== 安装依赖 ===" + - npm install -g pnpm + - pnpm install + - echo "=== 构建项目 ===" + - pnpm build + - echo "=== 检查构建结果 ===" + - ls -la dist/ + + - name: upload + image: appleboy/drone-scp + settings: + host: 193.112.151.199 + username: root + password: + from_secret: scp_password + port: 222 + source: + - dist/* + target: /opt/1panel/apps/openresty/openresty/www/sites/epic7/index + + - name: set permissions + image: appleboy/drone-ssh + settings: + host: 193.112.151.199 + username: root + password: + from_secret: scp_password + port: 222 + script: + - echo "=== 检查部署文件 ===" + - ls -la /opt/1panel/apps/openresty/openresty/www/sites/epic7/index/ + - echo "=== 设置文件权限 ===" + - chown -R www-data:www-data /opt/1panel/apps/openresty/openresty/www/sites/epic7/index/ + - chmod -R 755 /opt/1panel/apps/openresty/openresty/www/sites/epic7/index/ + - echo "=== 重启nginx服务 ===" + - systemctl reload nginx || echo "nginx reload failed, trying restart" + - systemctl restart nginx || echo "nginx restart failed" \ No newline at end of file