Skip to content

Compress Images

Compress Images #13

name: Compress Images
on:
workflow_dispatch:
schedule:
- cron: '00 23 * * 0'
env:
NODE_VERSION: '20.x'
jobs:
build:
name: Compress Images & Open PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@790ef463cba7b26ed3b1c80c1449deb72d4c0bcc # main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
- name: Open a PR if images can be compressed
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
title: 'Compressed Image Assets'
branch-suffix: timestamp
commit-message: 'compressed image assets'
body: ${{ steps.calibre.outputs.markdown }}
token: ${{ secrets.PAT_TOKEN }}