From 7e3fe006051e3437299f9fe63c8a3cd2048bb313 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Sun, 9 Jul 2023 05:50:21 +0800 Subject: [PATCH] fix drone config 12 --- .drone.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.drone.yml b/.drone.yml index cd36906..8cb5831 100644 --- a/.drone.yml +++ b/.drone.yml @@ -90,4 +90,48 @@ steps: - synchronized +--- +kind: pipeline +type: docker +name: main-pull-request-staging + +platform: + os: linux + arch: amd64 + +trigger: + branch: + include: + - main + +clone: + disable: true + +steps: +- name: deploy + image: appleboy/drone-ssh + settings: + host: + from_secret: host + username: root + key: + from_secret: ssh_key + port: 22 + script_stop: true + script: + - cd /var/www/todo + - git fetch + - git checkout ${DRONE_BRANCH} + - git reset --hard ${DRONE_COMMIT} + - docker-compose down + - docker-compose up -d --build --force-recreate + - docker image prune -f + when: + event: + - pull_request + action: + include: + - opened + - reopened + - synchronized