{"repo":"int128/docker-build-cache-config-action","free":true,"listed":false,"github":"https://github.com/int128/docker-build-cache-config-action","clone":"git clone https://github.com/int128/docker-build-cache-config-action.git","description":"Generate effective cache parameters for docker/build-push-action in GitHub Actions","language":"TypeScript","stars":22,"topics":["github-actions","docker","buildkit"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"docker-build-cache-config-action This action generates cache-from and cache-to inputs of docker/build-push-action for the effective cache strategy in the pull request based development flow. Problem to solve docker/build-push-action supports the cache management using Buildx (BuildKit). It can import and export a cache by the following parameters: If a same tag is used in the pull request based development flow, it will cause a cache miss. For example, 1. Initially, the cache points to main branch 1. When a pull request B is opened, - It imports the cache of main branch - The cache hits - It exports the cache of pull request B 1. When a pull request C is opened, - It imports the cache of pull request B - The cache misses - It exports the cache of pull request C 1. When the pull request B is merged into main, - It imports the cache of pull request C - The cache misses - It exports the cache of main branch Therefore, it needs to prevent the cache pollution caused by a pull request. How to solve Keep a cache tag tracking the corresponding branch. When the main branch is pushed, it imports a cache from the main tag. It finally exports a cache to the main tag for the future build. When a pull request is created or updated, it only imports a cache from the main tag. It does not export a cache to the main tag to prevent the cache pollution. If the base branch of the pull request is not main, it imports both base tag and main tag. Here is the diagram of this cache strategy. This acti","default_branch":null,"files":null,"tree":[],"storefront":"/r/int128","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/int128/docker-build-cache-config-action/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}