From 2bbdbaece56293c2767b183d1bd5eb0fcdb93d0d Mon Sep 17 00:00:00 2001 From: Aleksander Cynarski Date: Mon, 31 Aug 2020 18:36:53 +0200 Subject: [PATCH] new drone integration --- .drone.yml | 61 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/.drone.yml b/.drone.yml index 52fab33..f5d466d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,32 +1,39 @@ +--- kind: pipeline +type: docker name: default +trigger: + branch: + - master steps: -- name: build - image: plugins/hugo - settings: - pull: always - url: - from_secret: domain - validate: true +- name: Version check + image: paramah/hugo-deploy + commands: + - echo ">>> HUGO version check" + - hugo version -- name: deploy - image: appleboy/drone-scp - settings: - host: - from_secret: ssh_host - target: - from_secret: site_path - source: public/* - username: - from_secret: ssh_username - password: - from_secret: ssh_password - port: - from_secret: ssh_port - when: - branch: - - master - event: - exclude: - - pull_request +- name: Build + image: paramah/hugo-deploy + commands: + - npm install -D --save autoprefixer + - npm install -D --save postcss-cli + - git submodule update --init --recursive + - hugo --destination /drone/src/build + - minify -r -o /drone/src/build /drone/src/build + +- name: Upload + image: paramah/hugo-deploy + commands: + - eval `ssh-agent -s` + - echo "$SSH_KEY" | ssh-add - + - mkdir -p ~/.ssh + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + - rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum + environment: + SSH_KEY: + from_secret: drone_ssh_key + SSH_URI: + from_secret: ssh_uri + DEST: + from_secret: destination