Skip to content

Commit 9465277

Browse files
committed
chore: user lookup-only restore in Docker Cache step
1 parent 8b56499 commit 9465277

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/test.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,34 @@ jobs:
1818
docker-cache:
1919
name: Cache shared Docker images
2020
runs-on: ubuntu-latest
21+
env:
22+
DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }}
2123
steps:
2224
- name: Login to Docker Hub
2325
if: ${{ !github.event.pull_request.head.repo.fork }}
2426
uses: docker/login-action@v3
2527
with:
2628
username: ${{ secrets.DOCKER_USERNAME }}
2729
password: ${{ secrets.DOCKER_PASSWORD }}
28-
- name: Restore and update Docker cache
29-
id: docker-cache-restore
30-
uses: actions/cache@v4
31-
env:
32-
DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }}
30+
- id: cache-check
31+
uses: actions/cache/restore@v4
3332
with:
3433
path: ${{ env.DOCKER_IMAGES_TAR }}
3534
key: ${{ env.DOCKER_CACHE_KEY }}
35+
lookup-only: true # Only check if cache exists, don't download
3636
- name: Pull images
37-
if: steps.docker-cache-restore.outputs.cache-hit != 'true'
37+
if: steps.cache-check.outputs.cache-hit != 'true'
3838
run: |
3939
docker pull $IMG2VEC
4040
docker pull $MINIO
4141
# docker pull $MODEL2VEC
4242
docker save $IMG2VEC $MINIO -o $DOCKER_IMAGES_TAR
43+
- name: Cache images
44+
if: steps.cache-check.outputs.cache-hit != 'true'
45+
uses: actions/cache/save@v4
46+
with:
47+
path: ${{ env.DOCKER_IMAGES_TAR }}
48+
key: ${{ env.DOCKER_CACHE_KEY }}
4349

4450
maven-cache:
4551
name: Cache Maven dependencies
@@ -57,15 +63,15 @@ jobs:
5763
name: Test
5864
runs-on: ubuntu-latest
5965
needs: [ docker-cache, maven-cache]
66+
env:
67+
DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }}
6068
strategy:
6169
matrix:
6270
WEAVIATE_VERSION: ["1.32.0", "1.33.0"]
6371
steps:
6472
- uses: actions/checkout@v4
6573

66-
- uses: actions/cache@v4
67-
env:
68-
DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }}
74+
- uses: actions/cache/restore@v4
6975
with:
7076
path: ${{ env.DOCKER_IMAGES_TAR }}
7177
key: ${{ env.DOCKER_CACHE_KEY }}

0 commit comments

Comments
 (0)