Skip to content

Commit

Permalink
👷 Adds SVG & WEBP compression
Browse files Browse the repository at this point in the history
  • Loading branch information
walkxcode committed Oct 20, 2024
1 parent 6ca707f commit 7f1743a
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/compress_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y zopfli webp
sudo apt-get install -y zopfli webp npm
npm install -g svgo
- name: Compress PNG Files
Expand All @@ -31,18 +31,18 @@ jobs:
- name: Compress SVG Files
run: |
echo "Compressing SVGs..."
svgo -r -f svg/
svgo --config=svgo.config.js -f svg/
- name: Compress WEBP Files
run: |
echo "Compressing WEBPs..."
find webp/ -iname "*.webp" -print0 | xargs -0 -P 4 -I{} bash -c 'cwebp -quiet -q 80 "$1" -o "$1"' _ {}
find webp/ -iname "*.webp" -print0 | xargs -0 -P 4 -I{} bash -c 'cwebp -quiet -lossless "$1" -o "$1"' _ {}
- name: Commit and Push Changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "Dashboard Icons Bot"
git add png/ svg/ webp/
git commit -m ":compression: Compressed images" || exit 0
git commit -m ":compression: Compress icons" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}
60 changes: 60 additions & 0 deletions svg/3cx-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions svg/3cx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f1743a

Please sign in to comment.