fix: use registry cache with mode=max for full build stage caching
Replace inline cache with dedicated buildcache tag that stores all intermediate builder layers. Unchanged stages like deps and compile will be pulled from cache instead of rebuilt.
This commit is contained in:
parent
62b1487936
commit
ab8f0e472d
1 changed files with 3 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ jobs:
|
|||
echo "image=${{ secrets.REGISTRY_URL }}/${{ github.repository }}" >> $GITHUB_OUTPUT
|
||||
echo "sha_tag=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:${{ github.sha }}" >> $GITHUB_OUTPUT
|
||||
echo "latest_tag=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
|
||||
echo "cache_tag=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:buildcache" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
|
|
@ -46,10 +47,8 @@ jobs:
|
|||
tags: |
|
||||
${{ steps.meta.outputs.sha_tag }}
|
||||
${{ steps.meta.outputs.latest_tag }}
|
||||
cache-from: type=registry,ref=${{ steps.meta.outputs.latest_tag }}
|
||||
cache-to: type=inline
|
||||
build-args: |
|
||||
BUILDKIT_INLINE_CACHE=1
|
||||
cache-from: type=registry,ref=${{ steps.meta.outputs.cache_tag }}
|
||||
cache-to: type=registry,ref=${{ steps.meta.outputs.cache_tag }},mode=max
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue