Skip to content

Commit 39e3500

Browse files
authored
add image optimization (#30)
1 parent d3f2a34 commit 39e3500

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
env:
3737
NODE_ENV: production
3838

39+
- name: Optimize images
40+
continue-on-error: true
41+
run: |
42+
sudo apt-get install -y jpegoptim optipng gifsicle webp
43+
find out/images -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim --strip-all --max=85 {} \;
44+
find out/images -type f -iname "*.png" -exec optipng -o2 {} \;
45+
find out/images -type f -iname "*.gif" -exec gifsicle --batch -O3 {} \;
46+
3947
- name: Upload artifact
4048
uses: actions/upload-pages-artifact@v3
4149
with:

0 commit comments

Comments
 (0)