build-push-action
build-push-action copied to clipboard
Option to not push if a pull/rebuild hasn't changed anything and a boolean output `rebuilt`
I'd like to
- provide an option to not push if there isn't a rebuild
push_if_changed: trueor 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.
- If it doesn't, then I know that there must have been file changes in the branch commits ignored successfully by the
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
This would be very useful for me too.
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 }}.
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.
Hello, any update on this one?
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 https://github.com/docker/build-push-action/issues/994#issuecomment-1805831110
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.