From 18526ffd66605805228a46c548b0d7a0a024fadb Mon Sep 17 00:00:00 2001 From: samsapti Date: Tue, 24 May 2022 00:21:41 +0200 Subject: [PATCH] Add .drone.yml --- .drone.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..68cc2f8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,37 @@ +kind: pipeline +type: docker +name: build-and-deploy + +steps: + - name: build + image: klakegg/hugo:latest + volumes: + - name: build + path: /root/build + commands: + - hugo + - cp -rv public /root/build + + - name: deploy + image: alpine/git:latest + volumes: + - name: build + path: /root/build + environment: + SSH_USER: + from_secret: ssh_user + SSH_HOST: + from_secret: ssh_host + SSH_PORT: + from_secret: ssh_port + SSH_KEY: + from_secret: ssh_key + commands: + - mkdir $HOME/.ssh + - echo "$SSH_KEY" > $HOME/.ssh/id_ed25519 + - chmod 600 $HOME/.ssh/id_25519 + - scp -o "StrictHostKeyChecking no" -P ${SSH_PORT} -r /root/build/public ${SSH_USER}@${SSH_HOST}:docker/nginx/website + +volumes: + - name: build + temp: {} \ No newline at end of file