Whenever your pull request contains image changes, this Github action will run and create a commit of optimized images.
Create a image-optimization.yml file under .github/workflows, and have the following content:
name: Compress Images
on:
  pull_request:
    paths:
      - '**.jpg'
      - '**.png'
      - '**.ico'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout pull request
        uses: actions/checkout@master
      - name: Optimize images
        uses: docker://calibreapp/github-image-actions
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
					