web-backset.cn/.drone.yml
2023-03-20 16:59:42 +08:00

80 lines
1.5 KiB
YAML

---
kind: pipeline
type: docker
name: admin & web 资源发布
volumes:
- name: node_modules
host:
path: /home/drone/cache/node_modules
steps:
# web端
- name: build-web
image: node:16.19-alpine
# 容器内挂载点
volumes:
- name: node_modules
path: /drone/src/node_modules
commands:
- pwd
- node -v
- npm -v
- npm install -g pnpm
- pnpm i
- pnpm build:web
- name: deploy-web
image: appleboy/drone-scp:1.6
settings:
host:
- backset.cn
username: root
password: cr654654.
port: 22
overwrite: true
command_timeout: 2m
target: /www/wwwroot/nginx/html/backset.cn/
source: ./apps/web/dist/*
# admin管理
- name: build-admin
image: node:16.19-alpine
volumes:
- name: node_modules
path: /drone/src/node_modules
commands:
- pwd
- node -v
- npm -v
- npm install -g pnpm
- pnpm i
- pnpm build:admin
- name: deploy-admin
image: appleboy/drone-scp:1.6
settings:
host:
- backset.cn
username: root
password: cr654654.
port: 22
overwrite: true
command_timeout: 2m
target: /www/wwwroot/nginx/html/backset.cn/
source: ./apps/admin/dist/*
---
kind: pipeline
type: exec
name: server 镜像生产&容器发布
steps:
- name: docker image
commands:
- docker-compose build
- name: docker container
commands:
- docker-compose up -d