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