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

This commit is contained in:
Lizzy Hunt 2024-04-01 17:56:38 -06:00
parent 1fd1444f97
commit 2fc5f7aaf3
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 32 additions and 12 deletions

View File

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

12
deploy.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
echo $SSH_KEY >> /tmp/key
echo $SSH_KEY
echo $SSH_KEY | base64
chmod -R 0600 /tmp/key
ssh -i /tmp/key -o StrictHostKeyChecking=no root@hatecomputers.club "systemctl restart docker-compose@hatecomputers-club"
rm /tmp/key