From 7e98545d8e67dd5ebda2934a433921056bc51f6b Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..79a990e --- /dev/null +++ b/.drone.yml @@ -0,0 +1,52 @@ +--- +kind: pipeline +type: docker +name: deploy + +trigger: + branch: + - main + - master + event: + - push + +steps: + - name: package + image: docker.1ms.run/library/alpine:latest + commands: + - apk add --no-cache tar + - tar czf feishu-approval.tar.gz --exclude=.git --exclude=feishu-approval.tar.gz . + + - name: upload + image: appleboy/drone-scp:1.6.14 + settings: + host: + from_secret: deploy_host + username: + from_secret: deploy_user + port: 22 + target: /tmp + source: + - feishu-approval.tar.gz + overwrite: true + + - name: deploy + image: appleboy/drone-ssh:1.0.43 + settings: + host: + from_secret: deploy_host + username: + from_secret: deploy_user + port: 22 + script: + - set -e + - 'DEPLOY_PATH="/www/wwwroot/node_project"' + - 'ARCHIVE="/tmp/feishu-approval.tar.gz"' + - pm2 stop feishu_approval + - test -f "$ARCHIVE" + - mkdir -p "$DEPLOY_PATH" + - find "$DEPLOY_PATH" -mindepth 1 -delete + - tar xzf "$ARCHIVE" -C "$DEPLOY_PATH" + - chmod +x "$DEPLOY_PATH/deploy/start.sh" + - echo "Deploy OK -> $DEPLOY_PATH" + - pm2 start feishu_approval