auto-deploy/.drone.yml

51 lines
1.4 KiB
YAML

# 项目的.drone.yml 文件
kind: pipeline # 定义一个管道
type: docker # 定义管道类型
name: default # 定义管道名称
steps:
- name: public-npm # 步骤名称
image: node:12.22.5 # 使用镜像和版本
environment:
NPM:
from_secret: npm
commands:
- pwd # 查看当前目录 `/drone/src`
- ls -alt
- npm config set registry https://registry.npmjs.org # 切换官方仓库
- npm config set -- '//registry.npmjs.org/:_authToken' $NPM # 切换官方仓库
- npm publish --access public # 发布
when:
event: tag
- name: public-dllcnx # 步骤名称
image: node:12.22.5 # 使用镜像和版本
commands:
- pwd # 查看当前目录 `/drone/src`
- ls -alt
- npm config set registry https://dllcnx.com:30000/api/packages/dllcnx.github/npm/ # 切换私有仓库
- npm config set -- '//dllcnx.com:30000/api/packages/dllcnx.github/npm/:_authToken' $DLLCNX_NPM
# 切换私有仓库
- npm publish # 发布
environment:
DLLCNX_NPM:
from_secret: dllcnx_npm
when:
event: tag
- name: deploy-project
image: appleboy/drone-scp
settings:
host:
from_secret: uhost
username:
from_secret: uusername
password:
from_secret: upassword
port:
from_secret: uport
target: /docker/www/public/deploy
source: ./index.html
when:
event: tag