1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-24 22:16:08 -05:00

further optimize static images

This commit is contained in:
2019-11-09 11:54:11 -05:00
parent 32e1aa8098
commit 891beef4bd
14 changed files with 4 additions and 1 deletions

View File

@@ -34,13 +34,16 @@ jobs:
# Put a bow on top of Hugo's automatic image processing by using
# pngquant and jpegoptim to optimize/compress images in posts,
# just a little lossily (is that a word?)
#
# TODO: Find a way to cache the results, this takes about 4 minutes
# each build -- not ideal. Maybe use @sindresorhus/imagemin.
- name: Optimize processed images
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends jpegoptim pngquant optipng
cd $HOME/gh-pages/notes
find . -iname "*.jp*" -print0 | xargs -0 jpegoptim --max=80 --strip-all
find . -iname "*.png" -print0 | xargs -0 pngquant --quality=50-70 --speed 3 --ext=.png --force
find . -iname "*.png" -print0 | xargs -0 optipng -o2 -force -strip all -quiet --
find . -iname "*.png" -print0 | xargs -0 optipng -o3 -force -strip all -quiet --
# Ignore errors - override pipefail
shell: bash {0}