1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-15 01:42:10 +00:00
seirdy.one/deploy.sh
rohan kumar 6c4c58886a
CI: deploy website to multiple locations
Create a quick shell script that can deploy to localhost, my tilde
(staging), or seirdy.one.
2020-11-03 19:52:42 -08:00

26 lines
702 B
Bash
Executable file

#!/bin/sh
case "$1" in
seirdy.one)
login='deploy@seirdy.one' # user@host
www_prefix="$login:/var/www/seirdy.one"
gemini_prefix="$login:/srv/gemini/seirdy.one"
;;
envs.net)
login='seirdy@envs.net'
www_prefix="$login:/home/seirdy/public_html"
gemini_prefix="$login:/home/seirdy/public_gemini"
;;
localhost)
gemini_prefix='/tmp/gemini/serve/seirdy.one'
;;
*)
echo 'must supply hostname' >&2
exit 1
;;
esac
[ "$1" != 'localhost' ] \
&& rsync -rvzP --exclude "public/gemini" --exclude "*.gmi" public/ "$www_prefix/"
rsync -rvzP --exclude "*.html" public/gemini/ public/about public/posts "$gemini_prefix/"
rsync -rvzP public/posts/gemini/index.xml "$gemini_prefix/feed.xml"