From ab0f0a873a36aae1df440e3d3afa2313ee149601 Mon Sep 17 00:00:00 2001 From: lixin Date: Fri, 10 Jan 2025 14:31:33 +0800 Subject: [PATCH] =?UTF-8?q?ci(.drone.yml):=20=E9=87=8D=E6=9E=84=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E6=9E=84=E5=BB=BA=E6=B5=81=E7=A8=8B=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E7=BD=B2=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 pnpm 安装和配置步骤,提高包管理效率 - 分离代码克隆、依赖安装、构建和测试步骤,提升构建清晰度 - 添加 Docker 镜像构建和部署步骤,实现持续集成和部署 - 使用临时卷存储 node_modules,优化构建性能 --- .drone.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index b6ddbbe..2b4614c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,21 +9,36 @@ steps: - git clone http://120.48.5.80:3000/lixin/automated_api.git - cd automated_api -- name: node-dowun +- name: setup-pnpm image: node:22-alpine + commands: + - npm install -g pnpm + - pnpm config set registry https://registry.npmmirror.com + +- name: install-deps + image: node:22-alpine + commands: + - pnpm install + volumes: + - name: node_modules + path: /app/node_modules + +- name: build + image: node:22-alpine + commands: + - pnpm run build - name: docker-build image: plugins/docker settings: dockerfile: Dockerfile + repo: rz/automated_api + tags: latest + -- name: docker-run - image: docker:20.10 - commands: - - docker run -d -p 8001:8001 rz/automated_api:latest trigger: branch: - main event: - - push \ No newline at end of file + - push