add continuous deployment step
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Lizzy Hunt 2024-04-01 17:40:37 -06:00
parent 1fd1444f97
commit 625e4b570b
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 18 additions and 0 deletions

View File

@ -16,6 +16,14 @@ steps:
tags: tags:
- latest - latest
- main - main
- name: continuous deployment
image: alpine:latest
commands:
- apk add -y openssh
- sh deploy.sh
environment:
SSH_KEY:
from_secret: SSH_KEY
trigger: trigger:
branch: branch:
- main - main

10
deploy.sh Executable file
View File

@ -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