diff --git a/.drone.yml b/.drone.yml index 3b251d6..8b25da4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,14 @@ steps: tags: - latest - main +- name: continuous deployment + image: alpine:latest + commands: + - apk add -y openssh + - sh deploy.sh + environment: + SSH_KEY: + from_secret: SSH_KEY trigger: branch: - main diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..705f904 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +echo $SSH_KEY | base64 -d >> /tmp/key +chmod -R 0600 /tmp/key + +ssh -i /tmp/key -o StrictHostKeyChecking=no root@hatecomputers.club "systemctl restart docker-compose@hatecomputers-club" + +rm /tmp/key