diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..99c9521 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,45 @@ +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: remove # 删除旧的备份 + image: appleboy/drone-ssh # ssh插件 + environment: + DEPLOY_PATH: # 环境变量 + from_secret: /home/hxx/app/NginxProxyManager/data/access/myIndex/${DRONE_REPO_NAME} + settings: + host: + from_secret: host + username: + from_secret: username + password: + from_secret: password + port: 22 + command_timeout: 2m + envs: [DEPLOY_PATH] # 给 script 用 + script: + - rm -rf $${DEPLOY_PATH} + + - 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} # 这里的${DRONE_REPO_NAME}是vitesse + source: + - ./dist # 相对路径, 绝对路径是/app/dist \ No newline at end of file