From 625e4b570b523e731aaca72a9c9d53eb0c5ad7af Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Mon, 1 Apr 2024 17:40:37 -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..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