mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-10-23 22:18:57 +02:00
@@ -1,24 +1,22 @@
|
|||||||
name: 🗜️ PNG & SVG Compression
|
name: 🗜️ PNG & SVG Compression
|
||||||
|
'on':
|
||||||
on:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compress-images:
|
compress-images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y pngquant
|
sudo apt-get install -y pngquant
|
||||||
sudo npm install -g svgo
|
sudo npm install -g svgo
|
||||||
|
|
||||||
- name: Compress PNGs
|
- name: Compress PNGs
|
||||||
run: |
|
run: |
|
||||||
total_files=$(find png/ -iname "*.png" | wc -l)
|
total_files=$(find png/ -iname "*.png" | wc -l)
|
||||||
@@ -30,7 +28,7 @@ jobs:
|
|||||||
pngquant --force --ext .png --skip-if-larger --verbose --speed 1 $file
|
pngquant --force --ext .png --skip-if-larger --verbose --speed 1 $file
|
||||||
current_file=$((current_file+1))
|
current_file=$((current_file+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Compress SVGs
|
- name: Compress SVGs
|
||||||
run: |
|
run: |
|
||||||
total_files=$(find svg/ -iname "*.svg" | wc -l)
|
total_files=$(find svg/ -iname "*.svg" | wc -l)
|
||||||
@@ -42,12 +40,12 @@ jobs:
|
|||||||
svgo --quiet --multipass --show-progress $file
|
svgo --quiet --multipass --show-progress $file
|
||||||
current_file=$((current_file+1))
|
current_file=$((current_file+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Load to GitHub
|
- name: Load to GitHub
|
||||||
run: |-
|
run: |-
|
||||||
git diff
|
git diff
|
||||||
git config --global user.email "noreply@walkx.fyi"
|
git config --global user.email "noreply@walkx.fyi"
|
||||||
git config --global user.name "Dashboard Icons Bot"
|
git config --global user.name "Dashboard Icons Bot"
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m ":clamp: Compresses PNGs & SVGs" || exit 0
|
git commit -m ":clamp: Compresses PNGs & SVGs" || exit 0
|
||||||
git push
|
git push
|
||||||
Reference in New Issue
Block a user