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

This commit is contained in:
Lizzy Hunt 2024-04-01 17:45:02 -06:00
parent 1fd1444f97
commit 1402ccc459
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:
- 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

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