-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.24 KB
/
calibreapp-image-actions.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
name: Compress Images on Push to main branch
on:
push:
branches:
- master
paths:
- 'Web/**.jpg'
- 'Web/**.jpeg'
- 'Web/**.png'
- 'Web/**.webp'
jobs:
build:
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request') }}
name: calibreapp/image-actions
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@main
with:
githubToken: ${{ secrets.PAT }}
compressOnly: true
ignorePaths: '!(Web)/**'
- name: Create New Pull Request If Needed
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT }}
title: Compressed Images
branch-suffix: timestamp
commit-message: Compressed Images
body: ${{ steps.calibre.outputs.markdown }}
- name: Enable Pull Request Automerge
if: steps.calibre.outputs.markdown != ''
run: gh pr merge --merge --auto "$PULL_REQUEST_NUMBER"
env:
GH_TOKEN: ${{ secrets.PAT }}