From 7f1743a2db038f494e8012fcbd71ca108a6da574 Mon Sep 17 00:00:00 2001 From: Bjorn Lammers Date: Sun, 20 Oct 2024 20:33:11 +0200 Subject: [PATCH] :construction_worker: Adds SVG & WEBP compression --- .github/workflows/compress_icons.yml | 8 +-- svg/3cx-light.svg | 60 ++++++++++++++++++++++ svg/3cx.svg | 75 ++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 svg/3cx-light.svg create mode 100644 svg/3cx.svg diff --git a/.github/workflows/compress_icons.yml b/.github/workflows/compress_icons.yml index fe8f3f25..a2b1207a 100644 --- a/.github/workflows/compress_icons.yml +++ b/.github/workflows/compress_icons.yml @@ -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 @@ -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 "noreply@lammers.media" 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 }} diff --git a/svg/3cx-light.svg b/svg/3cx-light.svg new file mode 100644 index 00000000..2df17cb5 --- /dev/null +++ b/svg/3cx-light.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/svg/3cx.svg b/svg/3cx.svg new file mode 100644 index 00000000..f2be7fb8 --- /dev/null +++ b/svg/3cx.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + +