tilde.club/deploy.sh

24 lines
478 B
Bash
Raw Normal View History

2024-03-09 02:25:48 -05:00
#!/bin/sh
set -e
echo $SSH_KEY | base64 -d >> /tmp/key
chmod -R 0600 /tmp/key
2024-03-09 16:36:34 -05:00
cd dist
for item in *; do
2024-03-09 02:25:48 -05:00
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
2024-03-09 16:36:34 -05:00
cd ..
2024-03-09 02:25:48 -05:00
echo "finished copying to remote host..."
rm /tmp/key