diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b46341b..550682c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -49,11 +49,13 @@ jobs: run: hexo generate # Best-effort image optimization at build time: originals in source/ - # stay untouched, only the built artifact shrinks (~58% on this site). + # stay untouched, only the built artifact shrinks (~56% on this site). + # Note: oxipng is not packaged in the runner's Ubuntu apt repos; pngquant + # provides nearly all of the savings on its own. - name: Optimize images run: | - apt-get update -qq && apt-get install -y -qq pngquant oxipng jpegoptim - find public -type f -name '*.png' -exec sh -c 'pngquant --quality=80-95 --strip --force --skip-if-larger --output "$1" "$1"; oxipng -o max -q "$1"' _ {} \; + apt-get update -qq && apt-get install -y -qq pngquant jpegoptim + find public -type f -name '*.png' -exec sh -c 'pngquant --quality=80-95 --strip --force --skip-if-larger --output "$1" "$1"' _ {} \; find public -type f \( -name '*.jpg' -o -name '*.jpeg' \) -exec jpegoptim --max=90 --strip-all --threshold=5 -q {} \; echo "site size after optimization: $(du -sh public | cut -f1)"