From c255fefb2240e0e2605a42f3f8f8a3944f9ed2c2 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 29 Apr 2024 21:01:09 -0700 Subject: [PATCH] cd --- .drone.yml | 20 ++++++++++++++++++++ deploy.sh | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .drone.yml create mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..205eb86 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: build + image: fedora:39 + commands: + - yum install --assumeyes openssh + - sh deploy.sh + environment: + HOST: + from_secret: HOST + SSH_KEY: + from_secret: SSH_KEY + +trigger: + branch: + - main diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..bb2e026 --- /dev/null +++ b/deploy.sh @@ -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 $HOST "cd /home/lizzy/mistymountains && git pull && git reset --hard origin/master && npm run build && sudo systemctl restart mmt" + +rm /tmp/key