-
Notifications
You must be signed in to change notification settings - Fork 253
39 lines (33 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
# Compress images on demand (workflow_dispatch), and at 11pm every Sunday (schedule).
# Open a pull request if any images can be compressed
name: Optimize images
on:
workflow_dispatch:
schedule:
- cron: '00 23 * * 0'
jobs:
optimize-images:
name: Optimize images
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Resize images
uses: xprilion/img-resizer-inplace@v1
with:
target: ducks
dimensions: 300x300
- name: Compress Images
id: calibre
uses: calibreapp/[email protected]
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
pngQuality: '95'
- name: Create New Pull Request If Needed
uses: peter-evans/create-pull-request@v7
with:
title: '🍱 Auto optimize images'
branch-suffix: timestamp
commit-message: '🍱 Auto optimize images'
body: ${{ steps.calibre.outputs.markdown }}