Skip to content

Commit 1933099

Browse files
committed
Caching try
1 parent 30ca5f5 commit 1933099

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ jobs:
3434

3535
- name: Set up Docker Buildx
3636
uses: docker/setup-buildx-action@v3
37+
38+
- name: Cache Docker layers
39+
uses: actions/cache@v2
40+
with:
41+
path: /tmp/.buildkit-cache
42+
key: ${{ runner.os }}-buildx-${{ github.sha }}
43+
restore-keys: |
44+
${{ runner.os }}-buildx-
45+
46+
- name: Move new cache
47+
run: |
48+
rm -rf /tmp/.buildkit-cache
49+
mv /tmp/.buildkit-cache-new /tmp/.buildkit-cache
3750
3851
- name: Build and push
3952
run: docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --push --build-arg CODE_VERSION=${CODE_VERSION}

docker-compose.build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
cache_from:
5959
- type=local,src=/tmp/.buildkit-cache/osm-rails
6060
cache_to:
61-
- type=local,dest=/tmp/.buildkit-cache/osm-rails,mode=max
61+
- type=local,dest=/tmp/.buildkit-cache-new/osm-rails,mode=max
6262
context: osm-rails
6363
dockerfile: Dockerfile.prod
6464

@@ -72,7 +72,7 @@ services:
7272
cache_from:
7373
- type=local,src=/tmp/.buildkit-cache/osm-cgimap
7474
cache_to:
75-
- type=local,dest=/tmp/.buildkit-cache/osm-cgimap,mode=max
75+
- type=local,dest=/tmp/.buildkit-cache-new/osm-cgimap,mode=max
7676
context: osm-cgimap
7777
dockerfile: docker/ubuntu/Dockerfile2404
7878

0 commit comments

Comments
 (0)