tilde.club/deploy.sh
Elizabeth Hunt 19649ea71d
All checks were successful
continuous-integration/drone/push Build is passing
fix path
2024-03-09 14:36:34 -07:00

24 lines
478 B
Bash
Executable File

#!/bin/sh
set -e
echo $SSH_KEY | base64 -d >> /tmp/key
chmod -R 0600 /tmp/key
cd dist
for item in *; 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
cd ..
echo "finished copying to remote host..."
rm /tmp/key