From 4d1c097471e25810730af6cdd5486bee1a627356 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Mon, 1 Apr 2024 17:50:20 -0600 Subject: [PATCH] add continuous deployment step --- .drone.yml | 32 ++++++++++++++++++++------------ deploy.sh | 11 +++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml index 3b251d6..2be296d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,18 +4,26 @@ type: docker name: build and publish docker image steps: -- name: docker - image: plugins/docker - settings: - username: - from_secret: gitea_packpub_username - password: - from_secret: gitea_packpub_password - registry: git.hatecomputers.club - repo: git.hatecomputers.club/hatecomputers/hatecomputers.club - tags: - - latest - - main + #- name: docker + # image: plugins/docker + # settings: + # username: + # from_secret: gitea_packpub_username + # password: + # from_secret: gitea_packpub_password + # registry: git.hatecomputers.club + # repo: git.hatecomputers.club/hatecomputers/hatecomputers.club + # 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..647cf92 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +echo $SSH_KEY | base64 -d >> /tmp/key +cat /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