feat: 部署
This commit is contained in:
parent
a158249f23
commit
a201f113c3
28
.drone.yml
28
.drone.yml
@ -7,9 +7,30 @@ steps:
|
|||||||
- name: build
|
- name: build
|
||||||
image: node:lts
|
image: node:lts
|
||||||
commands:
|
commands:
|
||||||
|
- npm config set registry https://mirrors.huaweicloud.com/repository/npm/
|
||||||
|
- rm -rf dist
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
||||||
|
# 清除旧版本
|
||||||
|
- name: clean
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
when:
|
||||||
|
branch: deploy
|
||||||
|
event: push
|
||||||
|
settings:
|
||||||
|
host:
|
||||||
|
from_secret: ssh_host
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
command_timeout: 2m
|
||||||
|
script:
|
||||||
|
- 'rm -rf /root/sites/wuziqi.bitnet.fun/index/*'
|
||||||
|
|
||||||
# 部署
|
# 部署
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: appleboy/drone-scp
|
image: appleboy/drone-scp
|
||||||
@ -26,7 +47,8 @@ steps:
|
|||||||
port:
|
port:
|
||||||
from_secret: ssh_port
|
from_secret: ssh_port
|
||||||
command_timeout: 2m
|
command_timeout: 2m
|
||||||
target:
|
target: /root/sites/wuziqi.bitnet.fun/index/
|
||||||
from_secret: target
|
overwrite: true
|
||||||
source:
|
source:
|
||||||
- ./*
|
- ./dist/*
|
||||||
|
strip_components: 1
|
Loading…
Reference in New Issue
Block a user