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

This commit is contained in:
Elizabeth 2024-04-01 18:06:24 -06:00
parent 1fd1444f97
commit b5125a5954
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 33 additions and 12 deletions

View File

@ -4,18 +4,26 @@ type: docker
name: build and publish docker image name: build and publish docker image
steps: steps:
- name: docker #- name: docker
image: plugins/docker # image: plugins/docker
settings: # settings:
username: # username:
from_secret: gitea_packpub_username # from_secret: gitea_packpub_username
password: # password:
from_secret: gitea_packpub_password # from_secret: gitea_packpub_password
registry: git.hatecomputers.club # registry: git.hatecomputers.club
repo: git.hatecomputers.club/hatecomputers/hatecomputers.club # repo: git.hatecomputers.club/hatecomputers/hatecomputers.club
tags: # tags:
- latest # - latest
- main # - main
- name: continuous deployment
image: fedora:latest
commands:
- yum install --assumeyes openssh
- sh deploy.sh
environment:
SSH_KEY:
from_secret: cd_ssh_key
trigger: trigger:
branch: branch:
- main - main

13
deploy.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
echo $SSH_KEY >> /tmp/key
echo $SSH_KEY
echo $SSH_KEY | base64
echo $(cat /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