From c049512b92a64d53fd19591922a198fcbd28d3c7 Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Sun, 29 Nov 2026 14:51:35 -0800 Subject: [PATCH] Drop oxipng from CI image optimization (not in runner apt repos) --- .gitea/workflows/deploy.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)"