Skip to content

Commit a665b06

Browse files
authored
More fixes to new build
1 parent 3453f86 commit a665b06

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

.github/workflows/build_containers.yaml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ jobs:
4646
username: ${{ secrets.DOCKER_USERNAME }}
4747
password: ${{ secrets.DOCKER_PASSWORD }}
4848

49-
- name: Extract metadata
49+
- name: Extract metadata for container image
5050
id: meta
51-
uses: docker/metadata-action@v4
51+
uses: docker/metadata-action@v5
5252
with:
5353
images: ${{ github.repository_owner }}/${{ matrix.base.outname }}
5454
tags: |
@@ -64,7 +64,7 @@ jobs:
6464
file: Dockerfile
6565
platforms: linux/amd64
6666
labels: ${{ steps.meta.outputs.labels }}
67-
outputs: type=image,name=${{ github.repository_owner }}/${{ matrix.base.outname }},push-by-digest=true,name-canonical=true,push=true
67+
outputs: type=image,name=${{ steps.meta.outputs.images }},push-by-digest=true,name-canonical=true,push=true
6868

6969
- name: Export digest
7070
run: |
@@ -114,7 +114,7 @@ jobs:
114114

115115
- name: Extract metadata
116116
id: meta
117-
uses: docker/metadata-action@v4
117+
uses: docker/metadata-action@v5
118118
with:
119119
images: ${{ github.repository_owner }}/${{ matrix.base.outname }}
120120
tags: |
@@ -130,7 +130,7 @@ jobs:
130130
file: Dockerfile
131131
platforms: linux/arm64
132132
labels: ${{ steps.meta.outputs.labels }}
133-
outputs: type=image,name=${{ github.repository_owner }}/${{ matrix.base.outname }},push-by-digest=true,name-canonical=true,push=true
133+
outputs: type=image,name=${{ steps.meta.outputs.images }},push-by-digest=true,name-canonical=true,push=true
134134

135135
- name: Export digest
136136
run: |
@@ -152,13 +152,13 @@ jobs:
152152
strategy:
153153
matrix:
154154
base:
155-
- {image: 'ghcr.io/bioconductor/rocker-r-ver', armtag: 'devel-arm64', outname: 'r-ver'}
156-
- {image: 'ghcr.io/bioconductor/rocker-rstudio', armtag: 'devel-arm64', outname: 'bioconductor_docker'}
157-
- {image: 'rocker/tidyverse', armtag: 'N/A', outname: 'tidyverse'}
158-
- {image: 'ghcr.io/bioconductor/rocker-cuda', armtag: 'N/A', outname: 'cuda'}
159-
- {image: 'ghcr.io/bioconductor/rocker-ml', armtag: 'N/A', outname: 'ml'}
160-
- {image: 'ghcr.io/bioconductor/rocker-ml-verse', armtag: 'N/A', outname: 'ml-verse'}
161-
- {image: 'rocker/shiny', armtag: 'N/A', outname: 'shiny'}
155+
- {image: 'ghcr.io/bioconductor/rocker-r-ver', amdtag: 'devel-amd64', outname: 'r-ver', platforms: 'amd64,arm64'}
156+
- {image: 'ghcr.io/bioconductor/rocker-rstudio', amdtag: 'devel-amd64', outname: 'bioconductor_docker', platforms: 'amd64,arm64'}
157+
- {image: 'rocker/tidyverse', amdtag: 'devel', outname: 'tidyverse', platforms: 'amd64'}
158+
- {image: 'ghcr.io/bioconductor/rocker-cuda', amdtag: 'devel-amd64', outname: 'cuda', platforms: 'amd64'}
159+
- {image: 'ghcr.io/bioconductor/rocker-ml', amdtag: 'devel-amd64', outname: 'ml', platforms: 'amd64'}
160+
- {image: 'ghcr.io/bioconductor/rocker-ml-verse', amdtag: 'devel-amd64', outname: 'ml-verse', platforms: 'amd64'}
161+
- {image: 'rocker/shiny', amdtag: 'devel', outname: 'shiny', platforms: 'amd64'}
162162
steps:
163163
- name: Set up Docker Buildx
164164
uses: docker/setup-buildx-action@v2
@@ -176,14 +176,22 @@ jobs:
176176
username: ${{ secrets.DOCKER_USERNAME }}
177177
password: ${{ secrets.DOCKER_PASSWORD }}
178178

179+
- name: Echo platforms to build
180+
id: buildlist
181+
shell: bash
182+
run: |
183+
PLATFORMLIST="${{matrix.base.platforms}}"
184+
IFS=','; for item in $PLATFORMLIST; do echo "$item=build" >> $GITHUB_OUTPUT; done
185+
179186
- name: Download AMD64 digests
187+
if: steps.buildlist.outputs.amd64 == "build"
180188
uses: actions/download-artifact@v4
181189
with:
182190
name: digests-${{ matrix.base.outname }}-amd64
183191
path: /tmp/digests/amd64
184192

185193
- name: Download ARM64 digests
186-
if: matrix.base.armtag != 'N/A'
194+
if: steps.buildlist.outputs.arm64 == "build"
187195
uses: actions/download-artifact@v4
188196
with:
189197
name: digests-${{ matrix.base.outname }}-arm64
@@ -229,13 +237,8 @@ jobs:
229237
fi
230238
231239
# Create manifest list
232-
if [ "${{ matrix.base.armtag }}" != "N/A" ]; then
233-
# Both AMD64 and ARM64
234-
DIGESTS=$(cd /tmp/digests && find . -type f -exec echo "${{ github.repository_owner }}/${{ matrix.base.outname }}@sha256:{}" \; | sed 's/\.\//:/')
235-
else
236-
# AMD64 only
237-
DIGESTS=$(cd /tmp/digests/amd64 && find . -type f -exec echo "${{ github.repository_owner }}/${{ matrix.base.outname }}@sha256:{}" \; | sed 's/\.\//:/')
238-
fi
240+
DIGESTS=$(cd /tmp/digests && find . -type f -exec echo "${{ github.repository_owner }}/${{ matrix.base.outname }}@sha256:{}" \; | sed 's/\.\//:/')
241+
239242
240243
docker buildx imagetools create $TAG_ARGS $DIGESTS
241244

0 commit comments

Comments
 (0)