Skip to content

Commit e506ca7

Browse files
committed
fix caching
1 parent f12c32d commit e506ca7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/docker-builder-reusable.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ jobs:
110110
type=semver,enable={{is_default_branch}},value=${{ inputs.app_version }},pattern={{major}}.{{minor}},priority=1997
111111
type=semver,enable={{is_default_branch}},value=${{ inputs.app_version }},pattern={{major}},priority=1996
112112
113+
- name: Prepare variables
114+
id: vars
115+
run: |
116+
platform=${{ matrix.platform }}
117+
image=${{ steps.meta.outputs.tags }}
118+
{
119+
echo "platform_pair=${platform//\//-}"
120+
echo "platform_pair_un=${platform//\//_}"
121+
echo "image=${image%%:*}"
122+
} >> $GITHUB_OUTPUT
123+
113124
- name: Build and push Docker image
114125
id: build-and-push
115126
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
@@ -120,5 +131,5 @@ jobs:
120131
platforms: ${{ matrix.platform }}
121132
tags: ${{ steps.meta.outputs.tags }}
122133
labels: ${{ steps.meta.outputs.labels }}
123-
cache-from: type=gha
124-
cache-to: type=gha,mode=max
134+
cache-from: type=gha,scope=buildkit-layer-${{ steps.vars.outputs.platform_pair }}
135+
cache-to: type=gha,mode=max,scope=buildkit-layer-${{ steps.vars.outputs.platform_pair }}

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ jobs:
6767
image_name: ${{ github.repository }}/${{ matrix.container }}
6868
secrets:
6969
registry_username: ${{ github.actor }}
70-
registry_password: ${{ secrets.GITHUB_TOKEN }}
70+
registry_password: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)