Skip to content

Compress Images

Compress Images #6

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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- 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@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
title: 'Compressed Image Assets'
branch-suffix: timestamp
commit-message: 'compressed image assets'
body: ${{ steps.calibre.outputs.markdown }}
token: ${{ secrets.PAT_TOKEN }}