Add minify to post-receive hook
This commit is contained in:
parent
2e172d403d
commit
51ef6cf781
@ -15,6 +15,9 @@ trap "echo 'A problem occurred. Reverting to backup.'; rsync -aqz --del $BACKUP
|
|||||||
git clone --recursive $GIT_REPO $WORKING_DIRECTORY
|
git clone --recursive $GIT_REPO $WORKING_DIRECTORY
|
||||||
rm -rf $PUBLIC_WWW/*
|
rm -rf $PUBLIC_WWW/*
|
||||||
$HOME/.local/bin/hugo -s $WORKING_DIRECTORY -d ${PUBLIC_WWW} -b "https://${MY_DOMAIN}"
|
$HOME/.local/bin/hugo -s $WORKING_DIRECTORY -d ${PUBLIC_WWW} -b "https://${MY_DOMAIN}"
|
||||||
|
# minify files
|
||||||
|
./bin/minify_x86-64 -r -o $PUBLIC_WWW $PUBLIC_WWW
|
||||||
|
# ahead of time compression
|
||||||
find $PUBLIC_WWW -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) -exec gzip -v -k -f --best {} \; -exec touch -r {} "{}.gz" \;
|
find $PUBLIC_WWW -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) -exec gzip -v -k -f --best {} \; -exec touch -r {} "{}.gz" \;
|
||||||
rm -rf $WORKING_DIRECTORY
|
rm -rf $WORKING_DIRECTORY
|
||||||
trap - EXIT
|
trap - EXIT
|
||||||
|
Loading…
Reference in New Issue
Block a user