Skip to content

Commit

Permalink
Only remove old cache directory we know we are done with.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Oct 12, 2023
1 parent db9d788 commit 4e8d3eb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build-and-publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,27 +264,27 @@ jobs:
type=local,src=/tmp/.buildx-cache-amd64-old
push: true

- name: Remove old cache directories
run: |
rm -rf /tmp/.buildx-cache-*-old
- name: Cache build ${{matrix.image}} (amd64)
if: contains(env.TARGET_PLATFORMS, 'linux/amd64')
uses: docker/build-push-action@v5
with:
context: workshop-images/base-environment
platforms: linux/amd64
# cache-from: type=local,src=/tmp/.buildx-cache-amd64-old
cache-from: type=local,src=/tmp/.buildx-cache-amd64-old
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-amd64-new,compression=zstd
push: false

- name: Remove old cache directories
run: |
rm -rf /tmp/.buildx-cache-amd64-old
- name: Cache build ${{matrix.image}} (arm64)
if: contains(env.TARGET_PLATFORMS, 'linux/arm64')
uses: docker/build-push-action@v5
with:
context: workshop-images/base-environment
platforms: linux/arm64
# cache-from: type=local,src=/tmp/.buildx-cache-arm64-old
cache-from: type=local,src=/tmp/.buildx-cache-arm64-old
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-arm64-new,compression=zstd
push: false

Expand Down Expand Up @@ -418,10 +418,6 @@ jobs:
type=local,src=/tmp/.buildx-cache-amd64-old
push: true

- name: Remove old cache directories
run: |
rm -rf /tmp/.buildx-cache-*-old
- name: Cache build ${{matrix.image}} (amd64)
if: contains(env.TARGET_PLATFORMS, 'linux/amd64')
uses: docker/build-push-action@v5
Expand All @@ -432,10 +428,14 @@ jobs:
IMAGE_REPOSITORY=ghcr.io/${{env.REPOSITORY_OWNER}}
BASE_IMAGE_NAME=educates-base-environment
PACKAGE_VERSION=${{env.REPOSITORY_SHA_TAG}}
# cache-from: type=local,src=/tmp/.buildx-cache-amd64-old
cache-from: type=local,src=/tmp/.buildx-cache-amd64-old
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-amd64-new,compression=zstd
push: false

- name: Remove old cache directories
run: |
rm -rf /tmp/.buildx-cache-amd64-old
- name: Cache build ${{matrix.image}} (arm64)
if: contains(env.TARGET_PLATFORMS, 'linux/arm64')
uses: docker/build-push-action@v5
Expand All @@ -446,7 +446,7 @@ jobs:
IMAGE_REPOSITORY=ghcr.io/${{env.REPOSITORY_OWNER}}
BASE_IMAGE_NAME=educates-base-environment
PACKAGE_VERSION=${{env.REPOSITORY_SHA_TAG}}
# cache-from: type=local,src=/tmp/.buildx-cache-arm64-old
cache-from: type=local,src=/tmp/.buildx-cache-arm64-old
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-arm64-new,compression=zstd
push: false

Expand Down

0 comments on commit 4e8d3eb

Please sign in to comment.