automated_api/.drone.yml
lixin ab0f0a873a
Some checks reported errors
continuous-integration/drone/push Build was killed
ci(.drone.yml): 重构自动化构建流程并添加部署步骤
- 新增 pnpm 安装和配置步骤,提高包管理效率
- 分离代码克隆、依赖安装、构建和测试步骤,提升构建清晰度
- 添加 Docker 镜像构建和部署步骤,实现持续集成和部署
- 使用临时卷存储 node_modules,优化构建性能
2025-01-10 14:31:33 +08:00

45 lines
728 B
YAML

kind: pipeline
type: docker
name: default
steps:
- name: git-clone
image: alpine/git
commands:
- git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
- 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
trigger:
branch:
- main
event:
- push