Skip to content

Commit 616fa5a

Browse files
committed
feat: added caching of alpine base images
1 parent accefb5 commit 616fa5a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ jobs:
2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v2
2626

27+
# Cache Alpine Base Images
28+
- name: Cache Docker Base Images
29+
id: cache-docker-images
30+
uses: actions/cache@v3
31+
with:
32+
path: /tmp/.buildx-cache
33+
key: docker-base-images-${{ runner.os }}-${{ hashFiles('Dockerfile') }}
34+
restore-keys: |
35+
docker-base-images-${{ runner.os }}-
36+
37+
# Pre-fetch Alpine Base Images
38+
- name: Preload Base Images
39+
if: steps.cache-docker-images.outputs.cache-hit != 'true'
40+
run: |
41+
docker pull alpine:3.19
42+
docker pull alpine:3.20
43+
docker pull alpine:3.21
44+
docker pull alpine:latest
45+
46+
- name: Install Docker Compose
47+
uses: docker/setup-buildx-action@v2
48+
2749
# Cache Docker Compose
2850
- name: Cache Docker Compose
2951
id: cache-compose

0 commit comments

Comments
 (0)