~seirdy/seirdy.one

ref: 970fa0e0571502c9f61fb28609f450598d72b578 seirdy.one/deploy.sh -rwxr-xr-x 1.0 KiB
970fa0e0rohan kumar CI: Only gzip when deploying to seirdy.one 1 year, 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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)
		www_prefix='/tmp/www/seeirdy.one'
		gemini_prefix='/tmp/gemini/serve/seirdy.one'
		mkdir -p "$www_prefix" "$gemini_prefix"
		;;
	*)
		echo 'must supply hostname' >&2
		exit 1
		;;
esac

# I use gzip_static with nginx
if [ "$1" = 'seirdy.one' ]; then
	find public -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' \
		| grep -v gemini \
		| xargs zopfli
fi

rsync -avzP \
	--exclude 'gemini' --exclude '*.gmi' --exclude 'misc/' --exclude 'music.txt' --exclude '.well-known' \
	public/ "$www_prefix/" --delete
rsync -avzP \
	--exclude '*.html' --exclude 'misc/' --exclude 'music.txt' \
	public/gemini/ public/about public/posts "$gemini_prefix/" --delete
rsync -avzP public/posts/gemini.xml "$gemini_prefix/feed.xml"