From e30de01f8c93f93098831eae6b447b8598d5f530 Mon Sep 17 00:00:00 2001 From: Ching Date: Wed, 6 Mar 2024 11:13:00 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=A2=9E=E5=8A=A0=E9=83=A8=E7=BD=B2?= =?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 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..37197a4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,47 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: deploy + image: appleboy/drone-ssh + settings: + host: + - 148.135.109.242 + username: root + key: + from_secret: ssh_key + passphrase: + from_secret: ssh_passphrase + port: 22 + command_timeout: 2m + script: + - echo "Go to the project directory" + - cd /root/develop/discord-dota-bot + - echo "Pull the latest code" + - git pull + - echo "Restart service" + - supervisorctl restart dotabot + script_stop: true + + - name: discord notification + image: appleboy/drone-discord + settings: + webhook_id: + from_secret: discord_webhook_id + webhook_token: + from_secret: discord_webhook_token + # message: | + # Drone Build #${DRONE_BUILD_NUMBER} ${DRONE_BUILD_STATUS} + # Project: ${DRONE_REPO_NAME} + # Branch: ${DRONE_BRANCH} + # Commit: ${DRONE_COMMIT_SHA:0:8} + # [Build Log](${DRONE_BUILD_LINK}) + when: + status: [success, failure] + + +volumes: + - name: dockersock + host: + path: /var/run/docker.sock