Git Product home page Git Product logo

Comments (11)

benschwarz avatar benschwarz commented on May 18, 2024 1

Do we not need you to do a release for us to be able to use that?

@bazzadp Nope. Because GitHub Actions doesn't cache docker image builds. image-actions references a pre-built from the main branch Dockerhub hosted image..

Otherwise folks would have to wait 10+ mins for image actions to run πŸ˜“

from image-actions.

benschwarz avatar benschwarz commented on May 18, 2024 1

@bazzadp I should've said "could" conflict, was just trying to be mindful of other stuff that was in flight at the time.

changedFilesOnly seems like a reasonable idea, although I think we've got options that work well enough for the more common use cases.

Leaving this issue open to gauge interest for a while β€” if you've stumbled across this and think it'd be a useful feature, please let us know.

from image-actions.

benschwarz avatar benschwarz commented on May 18, 2024

@TomasBarry Here's what image actions does:

  • After each push to a PR, image-actions is invoked
  • Images that match the glob finder will be processed
  • Images that are 'significantly changed' are committed and added to the markdown summary

From what you're saying, it sounds like there's a byte difference of more than 1% each time you've committed.
Is that the case? Do you have any numbers/metrics to share with this report?

It might be that we need to increase the change threshold (say ~3%) to accommodate for cases like this.

Any additional information you have to share will be helpful :-)

from image-actions.

TomasBarry avatar TomasBarry commented on May 18, 2024

Hi @benschwarz. I actually can't find the data of the most recent examples because the comments were deleted...

An adjustable threshold would be pretty nice. But I was also thinking that it would be good to only run the action on assets in the pull request. In theory, assets not in the pull request should already be compressed and only touched assets should be in a pull request.

If you can point me in the right direction I don't mind having a look at implementing either of the above suggestions.

from image-actions.

benschwarz avatar benschwarz commented on May 18, 2024

Hey @TomasBarry, not sure what version of the image-actions config you're using, but if you haven't updated in a while, I'd recommend doing so.

The suggested default configuration will only run when image files (jpgs, webps etc) are changed within that pull request. Additionally there's also an configuration example for image actions to create pull requests, rather than jump in on work in progress. That might suit your use case better.

Could you check those out and report back?

from image-actions.

tunetheweb avatar tunetheweb commented on May 18, 2024

Do we not need you to do a release for us to be able to use that?

Also while it’s true that using the config in the README will only run if the PR contains images, of will then compress ALL images - not just those images in the PR. Personally I think that’s handy, but I can see why a changedFilesOnly flag could be useful - especially for larger repos.

from image-actions.

TomasBarry avatar TomasBarry commented on May 18, 2024

@benschwarz, we are using calibreapp/[email protected].

As @bazzadp said, a changedFilesOnly flag would be great but I was not aware that we could use it to create a separate PR which we might actually adopt for the time being.

Is there any intention of a changedFilesOnly flag in the future? I'd really back this feature given it would make QA on a PR constrained and on larger repos where many teams own many different parts of the code and you're not touching another teams code unless you meant to.

from image-actions.

benschwarz avatar benschwarz commented on May 18, 2024

@TomasBarry, I'm not sure about adding a changedFilesOnly config flag. It somewhat goes against the intention of having an action that ensures all images are compressed. Of course, I'd not considered the multi-team-repo-ownership use case. πŸ€”

Did you switch over to the "Create separate PR" config? Is that likely to work better?

πŸ’­ Implementation note: If we were to add a changedFilesOnly flag, it would conflict with compressOnly. It would need to warn about that (and be documented as such).

from image-actions.

tunetheweb avatar tunetheweb commented on May 18, 2024

πŸ’­ Implementation note: If we were to add a changedFilesOnly flag, it would conflict with compressOnly. It would need to warn about that (and be documented as such).

Not sure why it would conflict? Obviously it couldn't be used for the on-demand or scheduled options, but it could still be used with pull_requests and pushes if we checked files changed in those.

Personally I think this could still be helpful for large repos, as imaging the run time for the image action on those could be significant. With a changesFilesOnly option pull requests and pushes can be quick, and the scheduled run, where a user is not waiting for the result, can take longer to do the full repo and make sure no other images were missed, so still abiding by the intention of ensuring all images are compressed.

from image-actions.

benschwarz avatar benschwarz commented on May 18, 2024

Closing this off for now, feel free to weigh in if you have ideas πŸ’­

from image-actions.

hasan-wajahat avatar hasan-wajahat commented on May 18, 2024

Hey @benschwarz I have this setting for compressing image:

 - name: Compress Images
        id: calibre
        uses: calibreapp/image-actions@main
        with:
          ignorePaths: 'node_modules/**,build'
          compressOnly: true
          jpegQuality: '80'
          jpegProgressive: false
          pngQuality: '80'
          webpQuality: '80'

- name: Create New Pull Request If Needed
        if: steps.calibre.outputs.markdown != ''
        uses: peter-evans/create-pull-request@v3
        with:
          title: Compressed raster images
          branch: compress-raster-images
          branch-suffix: timestamp
          body: ${{ steps.calibre.outputs.markdown }}

Calibre keeps opening PR for already optimized images. But this only happens for WebP images and every time the change is of around 1-1.3%.

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.