Skip to content

Commit 70e28dc

Browse files
authored
Update main.yml
1 parent 75c4f84 commit 70e28dc

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,34 @@ jobs:
1515
- name: Checkout Repository
1616
uses: actions/checkout@v4
1717

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') != ''
1929
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
2131
2232
- name: Build Image
2333
shell: pwsh
2434
run: |
2535
docker build -f docker/mount.dockerfile -t app:latest .
2636
27-
- name: Cache Image with GHA
37+
- name: Save Docker Image to TAR
2838
shell: pwsh
2939
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 }}-

0 commit comments

Comments
 (0)