Skip to content

Commit 4c23e19

Browse files
committed
cicd[docker]: save cache for plattforms
1 parent 339f040 commit 4c23e19

File tree

1 file changed

+69
-13
lines changed

1 file changed

+69
-13
lines changed

.github/workflows/docker-matrix-wheels.yml

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,41 @@ jobs:
4747
platforms: linux/amd64,linux/arm/v6,linux/arm/v7
4848
push: false
4949
target: base
50-
cache-to: type=gha,mode=min,scope=base_stage_cross
50+
load: true
5151
cache-from: |
52-
type=gha,scope=base_stage_cross
52+
type=gha,scope=base_stage_amd64
53+
type=gha,scope=base_stage_armv7
54+
type=gha,scope=base_stage_armv6
5355
56+
- name: cache base image amd64
57+
uses: docker/build-push-action@v3.2.0
58+
with:
59+
context: .
60+
file: Dockerfile
61+
platforms: linux/amd64
62+
push: false
63+
target: base
64+
cache-to: type=gha,mode=min,scope=base_stage_amd64
65+
66+
- name: cache base image armv7
67+
uses: docker/build-push-action@v3.2.0
68+
with:
69+
context: .
70+
file: Dockerfile
71+
platforms: linux/arm/v7
72+
push: false
73+
target: base
74+
cache-to: type=gha,mode=min,scope=base_stage_armv7
75+
76+
- name: cache base image armv6
77+
uses: docker/build-push-action@v3.2.0
78+
with:
79+
context: .
80+
file: Dockerfile
81+
platforms: linux/arm/v6
82+
push: false
83+
target: base
84+
cache-to: type=gha,mode=min,scope=base_stage_armv6
5485

5586
prepare_matrix:
5687
# name: Find fhempy modules
@@ -82,9 +113,9 @@ jobs:
82113
do
83114
REQS=$(jq -cr 'select(.requirements != []).requirements' ./"$i"/manifest.json)
84115
## Just for testing the pipeline with a subset of modules
85-
## if ! [[ "$i" =~ ^(googlecast|geizhals|fhem_forum|bt_presence)$ ]]; then
86-
## continue
87-
## fi
116+
if ! [[ "$i" =~ ^(googlecast|geizhals|fhem_forum|bt_presence)$ ]]; then
117+
continue
118+
fi
88119
## End of test
89120
if [[ -z $REQS ]]; then
90121
continue
@@ -177,13 +208,12 @@ jobs:
177208
push: false
178209
load: true
179210
target: runtime
180-
cache-to: type=gha,scope=runtime-stage_cross-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }},ignore-error=true
211+
cache-to: type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-amd64
181212
tags: ${{ steps.meta.outputs.tags }}
182213
labels: ${{ steps.meta.outputs.labels }}
183214
cache-from: |
184-
type=gha,scope=base_stage_cross
185-
type=gha,scope=runtime-stage_cross-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}
186-
# type=gha,scope=runtime-stage_cross
215+
type=gha,scope=base_stage_amd64
216+
type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-amd64
187217
build-args: |
188218
PKGS=${{ matrix.PKGS }}
189219
@@ -236,12 +266,14 @@ jobs:
236266
target: runtime
237267
cache-to: type=gha,scope=runtime-stage_cross-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }},mode=max
238268
cache-from: |
239-
type=gha,scope=base_stage_cross
240-
type=gha,scope=runtime-stage_cross
241-
type=gha,scope=runtime-stage_cross-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}
269+
type=gha,scope=base_stage_amd64
270+
type=gha,scope=base_stage_armv6
271+
type=gha,scope=base_stage_armv7
272+
type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-amd64
273+
type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-armv7
242274
build-args: |
243275
PKGS=${{ matrix.PKGS }}
244-
276+
245277
- name: show image details
246278
run: |
247279
echo "${{ steps.docker_build_runtime_cross.outputs.imageid }}"
@@ -275,6 +307,30 @@ jobs:
275307
path: matrix_result.md
276308
if-no-files-found: warn
277309

310+
- name: cache armv7 image
311+
uses: docker/build-push-action@v3.2.0
312+
with:
313+
context: .
314+
platforms: linux/arm/v7
315+
push: false
316+
load: false
317+
target: runtime
318+
cache-to: type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-armv7
319+
build-args: |
320+
PKGS=${{ matrix.PKGS }}
321+
322+
- name: cache amd64 image
323+
uses: docker/build-push-action@v3.2.0
324+
with:
325+
context: .
326+
platforms: linux/amd64
327+
push: false
328+
load: false
329+
target: runtime
330+
cache-to: type=gha,scope=runtime-stage-${{ matrix.module }}_${{ hashFiles('./requirements_mod.txt') }}-amd64
331+
build-args: |
332+
PKGS=${{ matrix.PKGS }}
333+
278334
check-matrix:
279335
runs-on: ubuntu-latest
280336
needs: [buildImages,prepare_build]

0 commit comments

Comments
 (0)