Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thefoxis committed Nov 20, 2019
1 parent 91c878e commit 17ead42
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Image actions
# Image Actions

Image actions will automatically compress jpeg, png and webp images in GitHub Pull Requests.
Image Actions 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
- **Fast, efficient and near-lossless compression**
- Uses the best image compression algorithms available: [mozjpeg](https://github.com/mozilla/mozjpeg) and [libvips](https://github.com/libvips/libvips)
- Configurable and extensible: use default settings or adapt to your needs
- Runs in [GitHub Actions](https://github.com/features/actions)
- Built by web performance experts at [Calibre](https://calibreapp.com/); a performance monitoring platform

![Preview of image-actions pull request comment](https://user-images.githubusercontent.com/924/62024579-e1470d00-b218-11e9-8655-693ea42ba0f7.png)
![Preview of image-actions Pull Request comment](https://user-images.githubusercontent.com/924/62024579-e1470d00-b218-11e9-8655-693ea42ba0f7.png)

## How to add this to your repository:
## Add Image Actions 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:
1. Open or create the `.github/workflows/calibreapp-image-actions.yml` file.
2. Paste in the following:

```yml
name: Compress images
Expand All @@ -29,13 +30,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
The `GITHUB_TOKEN` secret is [automatically managed by GitHub](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret). You do not have to manually create this secret. This automatic token is [scoped only to the repository that is currently running the action.](https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions)
The `GITHUB_TOKEN` secret is [automatically generated by GitHub](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret). This automatic token is [scoped only to the repository that is currently running the action.](https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions)

## Configuration
## Configure Image Actions

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.
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.

Configuration can be set by adding a `.github/calibre/image-actions.yml` file:
Change the configuration options by adding a `.github/calibre/image-actions.yml` file:

```yml
jpeg:
Expand All @@ -48,12 +49,15 @@ ignorePaths:
- "node_modules/**"
```

- The above configuation is what image-actions uses by default
- The above configuation is what `image-actions` uses by default
- The `jpeg`, `png` and `webp` config keys will be delivered directly into [sharp’s](http://sharp.pixelplumbing.com) `toFormat`. ([JPEG options](http://sharp.pixelplumbing.com/en/stable/api-output/#jpeg), [PNG options](http://sharp.pixelplumbing.com/en/stable/api-output/#png), [Webp options](http://sharp.pixelplumbing.com/en/stable/api-output/#webp))
- `ignorePaths` allows for path globbing. [See the glob package for more details.](https://www.npmjs.com/package/glob)
- `ignorePaths` allows for path globbing [see the glob package for more details](https://www.npmjs.com/package/glob)

## Links and resources
## Links and Resources

- **[Announcement blog post](https://calibreapp.com/blog/compress-images-in-prs/)**
- [View calibre/image-actions on the GitHub Marketplace](https://github.com/marketplace/actions/image-actions)
- [Mozjpeg](https://github.com/mozilla/mozjpeg)
- **[Announcement post: Automatically compress images on Pull Requests](https://calibreapp.com/blog/compress-images-in-prs/)**
- [Image Actions on GitHub Marketplace](https://github.com/marketplace/actions/image-actions)
- [mozjpeg](https://github.com/mozilla/mozjpeg)
- [libvips](https://github.com/libvips/libvips)
- [Learn more about GitHub Actions](https://github.com/features/actions)
- [Start monitoring your sites performance](https://calibreapp.com/)

0 comments on commit 17ead42

Please sign in to comment.