Comments (4)
It will attempt to recompress it, but if it doesn't find significant savings then it will ignore it. This is also what happens if you upload an already optimised image.
I run this ever Sunday in my repo, and though the first few runs spotted a few uncompressed image after that it settled and now basically never alerts unless I really add an uncompressed image to the repo: https://github.com/HTTPArchive/almanac.httparchive.org/actions/workflows/compress-images.yml
from image-actions.
When #54 is merged then this can be done with an action something like this:
name: Compress images every morning at 8am, opening PRs if necessary
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '* 8 * * *'
jobs:
build:
name: calibreapp/image-actions
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@master
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
- name: Create New Pull Request
uses: peter-evans/create-pull-request@master
with:
title: Compressed Images
branch-suffix: timestamp
commit-message: Compressed Images
body: ${{ steps.calibre.outputs.markdown }}
from image-actions.
@tunetheweb @benschwarz
I have a question - will Github Image Action compress an already-compressed image? Let's say we have scheduled Image action to run every Sunday at 11:00 pm, so every time will it compress an image that is already optimized?
from image-actions.
Thanks !
from image-actions.
Related Issues (20)
- [Feature Request] Simple markdown template HOT 4
- Just a quick question! HOT 2
- [Bug] HTTPError when committing files HOT 3
- [Feature Request] Keep metadata when optimising images
- Limit markdown to 65535? HOT 4
- [Bug] `Input file contains unsupported image format` errors HOT 3
- Could you release major version(s) of your GitHub action? HOT 1
- [Feature Request] Can we have that command line utility for the same ? HOT 1
- Env variables are not being populated as expected HOT 1
- Bad Credentials error when following docs
- [Feature Request] Make a recent release with tag instead of `main` HOT 2
- Files compress in test repo but not Github Pages website even though code is the same. HOT 1
- [Feature Request] Support on-premise github enterprise HOT 2
- [Bug] WebP optimization requires successive passes to optimize HOT 1
- [Feature Request] Add option to disable PR comment HOT 6
- [Feature Request] How to get it to optimize images that are already inside the repo? HOT 1
- [Feature Request] Support for compressing PDFs HOT 2
- [Bug] 'set-output' warning HOT 2
- [Bug] image-actions rotates image unexpectedly HOT 9
- Agree this would be useful. And agree currently it does all files each time - that's working as intended at the moment btw, rather than a bug per se, though can understand why it's not what some would want.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-actions.