2424 dockerfile_context :
2525 required : false
2626 type : string
27+ default : ' .'
28+ # Optionally a list of "additional_contexts" to pass to Dockerfile. Defaults to empty
29+ dockerfile_additional_contexts :
30+ required : false
31+ type : string
32+ default : ' '
2733 # If Docker image should have additional tag flavor details (e.g. a suffix), it may be passed in.
2834 tags_flavor :
2935 required : false
6470 REDEPLOY_DEMO_URL : ${{ secrets.REDEPLOY_DEMO_URL }}
6571 # Current DSpace maintenance branch (and architecture) which is deployed to demo.dspace.org / sandbox.dspace.org
6672 # (NOTE: No deployment branch specified for sandbox.dspace.org as it uses the default_branch)
67- DEPLOY_DEMO_BRANCH : ' dspace-7_x '
73+ DEPLOY_DEMO_BRANCH : ' dspace-8_x '
6874 DEPLOY_ARCH : ' linux/amd64'
6975
7076jobs :
8793 runs-on : ${{ matrix.os }}
8894
8995 steps :
96+ # This step converts the slashes in the "arch" matrix values above into dashes & saves to env.ARCH_NAME
97+ # E.g. "linux/amd64" becomes "linux-amd64"
98+ # This is necessary because all upload artifacts CANNOT have special chars (like slashes)
99+ - name : Prepare
100+ run : |
101+ platform=${{ matrix.arch }}
102+ echo "ARCH_NAME=${platform//\//-}" >> $GITHUB_ENV
103+
90104 # https://github.com/actions/checkout
91105 - name : Checkout codebase
92106 uses : actions/checkout@v4
@@ -123,7 +137,9 @@ jobs:
123137 id : docker_build
124138 uses : docker/build-push-action@v5
125139 with :
126- context : ${{ inputs.dockerfile_context || '.' }}
140+ build-contexts : |
141+ ${{ inputs.dockerfile_additional_contexts }}
142+ context : ${{ inputs.dockerfile_context }}
127143 file : ${{ inputs.dockerfile_path }}
128144 platforms : ${{ matrix.arch }}
129145 # For pull requests, we run the Docker build (to ensure no PR changes break the build),
@@ -144,9 +160,9 @@ jobs:
144160 # Upload digest to an artifact, so that it can be used in manifest below
145161 - name : Upload Docker build digest to artifact
146162 if : ${{ ! matrix.isPr }}
147- uses : actions/upload-artifact@v3
163+ uses : actions/upload-artifact@v4
148164 with :
149- name : digests-${{ inputs.build_id }}
165+ name : digests-${{ inputs.build_id }}-${{ env.ARCH_NAME }}
150166 path : /tmp/digests/*
151167 if-no-files-found : error
152168 retention-days : 1
@@ -164,7 +180,7 @@ jobs:
164180
165181 # If this build is NOT a PR and passed in a REDEPLOY_DEMO_URL secret,
166182 # Then redeploy https://demo.dspace.org if this build is for our deployment architecture and demo branch.
167- - name : Redeploy demo.dspace.org (based on maintenace branch)
183+ - name : Redeploy demo.dspace.org (based on maintenance branch)
168184 if : |
169185 !matrix.isPR &&
170186 env.REDEPLOY_DEMO_URL != '' &&
@@ -184,10 +200,12 @@ jobs:
184200 - docker-build
185201 steps :
186202 - name : Download Docker build digests
187- uses : actions/download-artifact@v3
203+ uses : actions/download-artifact@v4
188204 with :
189- name : digests-${{ inputs.build_id }}
190205 path : /tmp/digests
206+ # Download digests for both AMD64 and ARM64 into same directory
207+ pattern : digests-${{ inputs.build_id }}-*
208+ merge-multiple : true
191209
192210 - name : Set up Docker Buildx
193211 uses : docker/setup-buildx-action@v3
0 commit comments