From a201f113c325694a4dfc0eb52cc65b17b4e0b518 Mon Sep 17 00:00:00 2001 From: gaze Date: Sun, 29 Dec 2024 17:12:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index fbbdfac..41b75ba 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,9 +7,30 @@ steps: - name: build image: node:lts commands: + - npm config set registry https://mirrors.huaweicloud.com/repository/npm/ + - rm -rf dist - npm install - 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 image: appleboy/drone-scp @@ -26,7 +47,8 @@ steps: port: from_secret: ssh_port command_timeout: 2m - target: - from_secret: target + target: /root/sites/wuziqi.bitnet.fun/index/ + overwrite: true source: - - ./* \ No newline at end of file + - ./dist/* + strip_components: 1 \ No newline at end of file