Skip to content
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

Option to not push if a pull/rebuild hasn't changed anything and a boolean output rebuilt #438

Closed
nitrocode opened this issue Aug 18, 2021 · 6 comments
Labels
area/buildkit kind/upstream Changes need to be made on upstream project

Comments

@nitrocode
Copy link

nitrocode commented Aug 18, 2021

I'd like to

  • provide an option to not push if there isn't a rebuild
    • push_if_changed: true or similar ?
  • know if the container had to rebuild, perhaps with an output
    • If it doesn't, then I know that there must have been file changes in the branch commits ignored successfully by the .dockerignore. If the container does not have to rebuild, then I do not have to redeploy the app.

We can detect if a previous build is the same as current build by comparing the Id which doesn't change if the docker build doesn't change.

docker inspect --format {{.Id}} $docker_image_name

Source: https://stackoverflow.com/a/45306984/2965993

@Aankhen
Copy link

Aankhen commented Aug 21, 2021

This would be very useful for me too.

@gdvalderrama
Copy link

Instead of having a new option push_if_changed, reusing push should be posible by referencing some new variable.
So instead of just push: true for example, using something like push: ${{ image_has_changed }}.

@crazy-max crazy-max added the kind/upstream Changes need to be made on upstream project label Jan 17, 2022
@crazy-max
Copy link
Member

This would be part of the build reproducibility we have started to work on: https://github.com/moby/buildkit/blob/master/docs/build-repro.md.

@danieletorelli
Copy link

Hello, any update on this one?

@crazy-max
Copy link
Member

crazy-max commented Mar 8, 2024

Closing as this is not directly related to the action but BuildKit (maybe Buildx as well). See also https://github.com/moby/buildkit/blob/master/docs/build-repro.md#source_date_epoch and #994 (comment)

@douglasparker
Copy link

Closing as this is not directly related to the action but BuildKit (maybe Buildx as well). See also https://github.com/moby/buildkit/blob/master/docs/build-repro.md#source_date_epoch and #994 (comment)

I’m not sure how what you linked helps us… Please reconsider this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/buildkit kind/upstream Changes need to be made on upstream project
Projects
None yet
Development

No branches or pull requests

6 participants