-
-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (39 loc) · 1.13 KB
/
image-optimization.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
name: image-optimization
on:
pull_request:
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.webp'
push:
branches:
- main
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.webp'
workflow_dispatch:
schedule:
- cron: '00 23 * * 0'
jobs:
image-optimization:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Optimize images
id: images
uses: calibreapp/image-actions@main
with:
compressOnly: ${{ github.event_name != 'pull_request' }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create pull request
if: steps.images.outputs.markdown != ''
uses: peter-evans/create-pull-request@v4
with:
title: Optimizes images.
branch-suffix: timestamp
commit-message: Optimizes images.
body: ${{ steps.images.outputs.markdown }}