File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -15,18 +15,34 @@ jobs:
15
15
- name : Checkout Repository
16
16
uses : actions/checkout@v4
17
17
18
- - name : Download BuildKit
18
+ - name : Restore Cached Image TAR
19
+ uses : actions/cache@v4
20
+ with :
21
+ path : cache-image.tar
22
+ key : docker-image-${{ runner.os }}-${{ github.run_id }}
23
+ restore-keys : |
24
+ docker-image-${{ runner.os }}-
25
+
26
+ - name : Load Cached Image
27
+ shell : pwsh
28
+ if : success() && hashFiles('cache-image.tar') != ''
19
29
run : |
20
- curl -SL --output buildx.exe https://github.com/docker/buildx/releases/download/v0.22.0-rc1/buildx-v0.22.0-rc1.windows-amd64.exe
30
+ docker load -i cache-image.tar
21
31
22
32
- name : Build Image
23
33
shell : pwsh
24
34
run : |
25
35
docker build -f docker/mount.dockerfile -t app:latest .
26
36
27
- - name : Cache Image with GHA
37
+ - name : Save Docker Image to TAR
28
38
shell : pwsh
29
39
run : |
30
- $env:DOCKER_BUILDKIT=1
31
- $env:BUILDX_EXPERIMENTAL=1
32
- .\buildx.exe build --push -f docker/xcache.dockerfile --cache-to type=gha,mode=max --cache-from type=gha -t app:latest .
40
+ docker save -o cache-image.tar app:latest
41
+
42
+ - name : Cache Image TAR
43
+ uses : actions/cache@v4
44
+ with :
45
+ path : cache-image.tar
46
+ key : docker-image-${{ runner.os }}-${{ github.run_id }}
47
+ restore-keys : |
48
+ docker-image-${{ runner.os }}-
You can’t perform that action at this time.
0 commit comments