-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Scheduled/periodic runs #70
Comments
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 }} |
@tunetheweb @benschwarz |
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 |
Thanks ! |
At the moment
image-actions
runs only when you've updated a pull request. Images are optimised and committed inline.In most cases, this works quite well, but there are some drawbacks to this approach:
By using GitHub Actions scheduler,
image-actions
could:This issue stands as a mark of intent to implement. If anyone has the bandwidth to help, please let me know or submit a PR 🏆
The text was updated successfully, but these errors were encountered: