summaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-09 00:25:48 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-09 14:35:46 -0700
commit6a4fc2d15141cd922327267e376302f65a3bb277 (patch)
tree1e9e7db386433021813f4099f154803ce10af363 /deploy.sh
downloadtilde.club-6a4fc2d15141cd922327267e376302f65a3bb277.tar.gz
tilde.club-6a4fc2d15141cd922327267e376302f65a3bb277.zip
rsync
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..0799a23
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+echo $SSH_KEY | base64 -d >> /tmp/key
+chmod -R 0600 /tmp/key
+
+for item in dist/*; do
+ echo "copying $item"
+ if [ -d "$item" ]; then
+ SOURCE_PATH="$item/"
+ DEST_PATH="$RSYNC_DESTINATION/$item/"
+ else
+ SOURCE_PATH="$item"
+ DEST_PATH="$RSYNC_DESTINATION"
+ fi
+ rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=no" -avz --delete $SOURCE_PATH $DEST_PATH
+done
+echo "finished copying to remote host..."
+
+rm /tmp/key