-
Notifications
You must be signed in to change notification settings - Fork 569
48 lines (40 loc) · 1.32 KB
/
compress_icons.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Compress Icons
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
compress_icons:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y zopfli webp npm
npm install -g svgo
- name: Compress PNG Files
run: |
echo "Compressing PNGs..."
find png/ -iname "*.png" -print0 | xargs -0 -P 4 -I{} zopflipng -y {} {}
#- name: Compress SVG Files
# run: |
# echo "Compressing SVGs..."
# svgo -f svg/
- name: Compress WEBP Files
run: |
echo "Compressing WEBPs..."
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 "ci(github-actions): compress icons" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}