From 388e537c0c0f0b58eae2064c95189aaebfbf0938 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Mon, 1 Apr 2024 17:52:53 -0600 Subject: [PATCH] add continuous deployment step --- .drone.yml | 32 ++++++++++++++++++++------------ deploy.sh | 10 ++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml index 3b251d6..ee8b8a6 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: cd_ssh_key trigger: branch: - main diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..505f603 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +echo $SSH_KEY >> /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