vitesse/.drone.yml
jqtmviyu d349196139
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
change ci
2023-04-19 23:06:32 +08:00

48 lines
1.4 KiB
YAML

kind: pipeline
type: docker
name: ci
steps:
- name: install & build # 流水线名称
image: node # 定义创建容器的Docker镜像
commands: # 定义在Docker容器中执行的shell命令
- npm config set registry http://mirrors.cloud.tencent.com/npm/
- npm i -g pnpm
- pnpm i
- pnpm run build
- name: upload
image: appleboy/drone-scp # 上传插件
settings:
host:
from_secret: host # 作为环境变量传进来
username:
from_secret: username
password:
from_secret: password
port: 22
command_timeout: 2m
target: /home/hxx/app/NginxProxyManager/data/access/myIndex/${DRONE_REPO_NAME}_new # 这里的${DRONE_REPO_NAME}是vitesse
source:
- ./dist # 相对路径, 绝对路径是/app/dist
- name: deploy # 部署
image: appleboy/drone-ssh # ssh插件
settings:
host:
from_secret: host
username:
from_secret: username
password:
from_secret: password
port: 22
command_timeout: 2m
envs: [DEPLOY_PATH] # 给 script 用
script:
- cd /home/hxx/app/NginxProxyManager/data/access/myIndex/
- rm -rf vitesse_old
- mv vitesse vitesse_old
- mv vitesse_new vitesse
- cd vitesse
- mv ./dist/* ./
- rm -rf ./dist