Skip to content
image

GitHub Action

image-actions

1.0.0 Latest version
Use latest version
image

image-actions

Automagically compress images in your repository

Installation

Copy and paste the following snippet into your .yml file.

- name: image-actions
  uses: calibreapp/image-actions@1.0.0
Learn more about this action in calibreapp/image-actions
Choose a version

Image Actions

Image Actions automatically compress JPEG, PNG and WebP images in GitHub Pull Requests.

  • Fast, efficient and near-lossless compression
  • Uses the best image compression algorithms available: mozjpeg and libvips
  • Configurable and extensible: use default settings or adapt to your needs
  • Runs in GitHub Actions
  • Built by web performance experts at Calibre; a performance monitoring platform

Preview of image-actions Pull Request comment

Add Image Actions to your repository

  1. Open or create the .github/workflows/calibreapp-image-actions.yml file.
  2. Paste in the following:
name: Compress images
on: pull_request
jobs:
  build:
    name: calibreapp/image-actions
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: calibreapp/image-actions
        uses: docker://calibreapp/github-image-actions
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The GITHUB_TOKEN secret is automatically generated by GitHub. This automatic token is scoped only to the repository that is currently running the action.

Configure Image Actions

By default, you probably don’t need to configure image-actions. However, if you’d like to ignore specific file paths, or change image compression options, read on.

Change the configuration options by adding a .github/calibre/image-actions.yml file:

jpeg:
  quality: 80
png:
  quality: 80
webp:
  quality: 80
ignorePaths:
  - "node_modules/**"

Links and Resources

You can’t perform that action at this time.