@@ -130,7 +130,7 @@ jobs:
130130 cache-to : type=gha,mode=max,scope=base_linux/${{ matrix.platform }}-${{ matrix.dockerfile }}
131131 tags : baseonly
132132
133- base_cpan_build :
133+ cpan_build :
134134 needs : [get_dependencies, base_build]
135135 runs-on : ubuntu-latest
136136 strategy :
@@ -175,7 +175,7 @@ jobs:
175175 GHCR_ACCESS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
176176 DOCKERFILE : ${{ matrix.dockerfile }}
177177
178- - name : Build base cpan layer for ${{ matrix.platform }}
178+ - name : Build cpan packages for ${{ matrix.platform }}
179179 uses : docker/build-push-action@v5
180180 with :
181181 context : .
@@ -188,7 +188,7 @@ jobs:
188188 type=gha,scope=base_linux/${{ matrix.platform }}-${{ matrix.dockerfile }}
189189 type=gha,scope=base-cpan_linux/${{ matrix.platform }}-${{ matrix.dockerfile }}
190190 cache-to : type=gha,mode=max,scope=base-cpan_linux/${{ matrix.platform }}-${{ matrix.dockerfile }}
191- tags : basecpanonly
191+ tags : buildcpanonly
192192
193193
194194 test_build :
@@ -254,6 +254,30 @@ jobs:
254254 type=ref,event=branch,suffix=${{ matrix.dockerfile }}
255255 type=ref,event=pr,suffix=${{ matrix.dockerfile }}
256256
257+ - name : Build and cache fhem base layer
258+ uses : docker/build-push-action@v5
259+ id : docker_build_fhem
260+ with :
261+ context : .
262+ load : true
263+ file : ./Dockerfile${{ matrix.dockerfile }}
264+ platforms : linux/amd64
265+ push : false
266+ target : with-fhem-bats
267+ cache-from : |
268+ type=gha,scope=fhem_linux/amd64-${{ matrix.dockerfile }}
269+ type=gha,scope=base_linux/amd64-${{ matrix.dockerfile }}
270+ cache-to : type=gha,mode=max,scope=fhem_linux/amd64-${{ matrix.dockerfile }}
271+ tags : with-fhem
272+ labels : ${{ steps.meta.outputs.labels }}
273+ build-args : |
274+ BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
275+ IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
276+ IMAGE_VCS_REF=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
277+ L_USAGE=${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/README.md
278+ L_VCS_URL=${{ github.server_url }}/${{ github.repository }}/
279+ L_AUTHORS=${{ github.server_url }}/${{ github.repository }}/graphs/contributors
280+
257281 - name : Build for bats with fhem base layer
258282 uses : docker/build-push-action@v5
259283 id : docker_build_bats
@@ -265,9 +289,7 @@ jobs:
265289 push : false
266290 target : with-fhem-bats
267291 cache-from : |
268- type=gha,scope=base_linux/amd64-${{ matrix.dockerfile }}
269- type=gha,scope=full_linux/amd64-${{ matrix.dockerfile }}
270- cache-to : type=gha,mode=max,scope=full_linux/amd64-${{ matrix.dockerfile }}
292+ type=gha,scope=fhem_linux/amd64-${{ matrix.dockerfile }}
271293 tags : bats-withfhem
272294 labels : ${{ steps.meta.outputs.labels }}
273295 build-args : |
@@ -301,8 +323,8 @@ jobs:
301323 push : false
302324 target : with-fhem-extended-python-nodejs
303325 cache-from : |
304- type=gha,scope=base_linux /amd64-${{ matrix.dockerfile }}
305- type=gha,scope=full_linux /amd64-${{ matrix.dockerfile }}
326+ type=gha,scope=full_linux /amd64-${{ matrix.dockerfile }}
327+ type=gha,scope=fhem_linux /amd64-${{ matrix.dockerfile }}
306328 cache-to : type=gha,mode=max,scope=full_linux/amd64-${{ matrix.dockerfile }}
307329 tags : ${{ steps.meta.outputs.tags }}
308330 labels : ${{ steps.meta.outputs.labels }}
@@ -333,7 +355,7 @@ jobs:
333355
334356 published_build :
335357 runs-on : ubuntu-latest
336- needs : [test_build, base_cpan_build ]
358+ needs : [test_build, cpan_build ]
337359 strategy :
338360 matrix :
339361 dockerfile : [-bullseye, -threaded-bullseye]
@@ -397,10 +419,11 @@ jobs:
397419 context : .
398420 load : false
399421 file : ./Dockerfile${{ matrix.dockerfile }}
400- platforms : linux/amd64,linux/arm/v7,linux/arm64
422+ platforms : linux/amd64,linux/arm/v7,linux/arm64,linux/386
401423 push : ${{ github.event_name != 'pull_request' }}
402424 target : with-fhem-extended-python-nodejs
403425 cache-from : |
426+ type=gha,scope=base-cpan_linux/386-${{ matrix.dockerfile }}
404427 type=gha,scope=base-cpan_linux/arm64-${{ matrix.dockerfile }}
405428 type=gha,scope=base-cpan_linux/arm/v7-${{ matrix.dockerfile }}
406429 type=gha,scope=full_linux/amd64-${{ matrix.dockerfile }}
@@ -440,17 +463,16 @@ jobs:
440463 context : .
441464 load : false
442465 file : ./Dockerfile${{ matrix.dockerfile }}
443- platforms : linux/386,linux/amd64,linux/arm/v7,linux/arm64
466+ platforms : linux/386,linux/amd64,linux/arm/v7,linux/arm64,386
444467 push : ${{ github.event_name != 'pull_request' }}
445468 target : with-fhem
446469 cache-from : |
447470 type=gha,scope=base_linux/arm64-${{ matrix.dockerfile }}
448471 type=gha,scope=base_linux/amd64-${{ matrix.dockerfile }}
449472 type=gha,scope=base_linux/arm/v7-${{ matrix.dockerfile }}
473+ type=gha,scope=base_linux/386-${{ matrix.dockerfile }}
450474 type=gha,scope=full_linux/amd64-${{ matrix.dockerfile }}
451475 type=gha,scope=full_linux/cross-${{ matrix.dockerfile }}
452- type=gha,scope=base_linux/cross-${{ matrix.dockerfile }}
453- cache-to : type=gha,mode=max,scope=base_linux/cross-${{ matrix.dockerfile }}
454476 tags : ${{ steps.meta_base.outputs.tags }}
455477 labels : ${{ steps.meta_base.outputs.labels }}
456478 build-args : |
0 commit comments