Skip to content
A Github Action that will automatically compress images with mozjpeg
JavaScript Dockerfile Shell Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Builds are now handled by Dockerhub Sep 12, 2019
__tests__ Stats are marginally different on linux. This should be fun Aug 1, 2019
src
tests Added everything Apr 16, 2019
.gitignore Added everything Apr 16, 2019
Brewfile
Dockerfile Remove labels Sep 11, 2019
LICENSE
README.md Updated readme Sep 17, 2019
entrypoint.js Remove unused constant Aug 2, 2019
package-lock.json Merge branch 'master' of https://github.com/calibreapp/image-actions Aug 1, 2019
package.json Added tests for markdown generation and image processing output Jul 31, 2019

README.md

Image actions

Image actions will automatically compress jpeg, png and webp images in GitHub Pull Requests.

  • Compression is fast, efficient and near-lossless
  • Uses mozjpeg + libvips, the best image compression available
  • Runs in GitHub Actions, so it's visible to everyone
  • Configurable: Use the great defaults or change to suit your needs

Preview of image-actions pull request comment

How to add this to your repository:

  • Add the following steps to a workflow file found at: .github/workflows/calibreapp-image-actions.yml (If you don’t have one, create it.)
  • 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 managed by GitHub. You do not have to manually create this secret. This automatic token is scoped only to the repository that is currently running the action.

Configuration

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

Configuration can be set 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.