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

This commit is contained in:
Lizzy Hunt 2024-04-01 17:51:14 -06:00
parent 1fd1444f97
commit b2b732ac38
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 31 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: SSH_KEY
trigger:
branch:
- main

11
deploy.sh Executable file
View File

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