Coder Social home page Coder Social logo

Comments (4)

tunetheweb avatar tunetheweb commented on May 19, 2024 1

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.

tunetheweb avatar tunetheweb commented on May 19, 2024

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.

KshitijDarekar avatar KshitijDarekar commented on May 19, 2024

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

KshitijDarekar avatar KshitijDarekar commented on May 19, 2024

Thanks !

from image-actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.