From 1402ccc4592490285dc756549632f07743dd49bf Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Mon, 1 Apr 2024 17:45:02 -0600 Subject: [PATCH] add continuous deployment step --- .drone.yml | 8 ++++++++ deploy.sh | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml index 3b251d6..b7608e9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,14 @@ steps: tags: - latest - main +- name: continuous deployment + image: alpine:latest + commands: + - apk add 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