-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (36 loc) · 1.01 KB
/
optimize-images.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
name: Optimize images
on:
schedule:
- cron: "15 14 * * *"
jobs:
build:
name: Optimize PNG images
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache Oxipng
uses: actions/cache@v3
with:
path: ~/.cargo/
key: ${{ runner.os }}-cargo
- name: Install Oxipng
run: |
cargo install oxipng
- name: Optimize PNGs
run: |
pushd website/static/img
# -o 4 is the highest recommended level of optimization
oxipng -o 4 -i 0 --strip safe *.png
popd
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v9.1
id: verify-changed-files
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: EndBug/add-and-commit@v7
with:
add: 'website'
default_author: github_actor
message: 'Optimize images'
signoff: true