Compressed Images (#566) #254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compress Images on Push to main branch | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "**.jpg" | |
- "**.jpeg" | |
- "**.png" | |
jobs: | |
build: | |
name: calibreapp/image-actions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Compress Images | |
id: calibre | |
uses: calibreapp/image-actions@main | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
compressOnly: true | |
- name: Create New Pull Request If Needed | |
if: steps.calibre.outputs.markdown != '' && github.event.commits[0].author.name != 'GitHubActions' | |
uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7 | |
with: | |
title: Compressed Images | |
branch-suffix: timestamp | |
commit-message: Compressed Images | |
body: ${{ steps.calibre.outputs.markdown }} |