Commits

Tim Donohue authored fd645452a54
Trigger redeploy of demo/sandbox from GitHub Actions after DockerHub image updated.
No tags

.github/workflows/docker.yml

Modified
16 16 contents: read # to fetch code (actions/checkout)
17 17
18 18
19 19 env:
20 20 REGISTRY_IMAGE: dspace/dspace-angular
21 21 # Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
22 22 # For a new commit on default branch (main), use the literal tag 'latest' on Docker image.
23 23 # For a new commit on other branches, use the branch name as the tag for Docker image.
24 24 # For a new tag, copy that tag name as the tag for Docker image.
25 25 IMAGE_TAGS: |
26 - type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
27 - type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
26 + type=raw,value=latest,enable=${{ github.ref_name == github.event.repository.default_branch }}
27 + type=ref,event=branch,enable=${{ github.ref_name != github.event.repository.default_branch }}
28 28 type=ref,event=tag
29 29 # Define default tag "flavor" for docker/metadata-action per
30 30 # https://github.com/docker/metadata-action#flavor-input
31 31 # We manage the 'latest' tag ourselves to the 'main' branch (see settings above)
32 32 TAGS_FLAVOR: |
33 33 latest=false
34 34
35 35 jobs:
36 36 #############################################################
37 37 # Build/Push the '${{ env.REGISTRY_IMAGE }}' image
293 293
294 294 - name: Create manifest list from digests and push
295 295 working-directory: /tmp/digests
296 296 run: |
297 297 docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
298 298 $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
299 299
300 300 - name: Inspect image
301 301 run: |
302 302 docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta_dist.outputs.version }}
303 +
304 + # Deploy latest -dist image to Demo or Sandbox site, based on the branch updated
305 + dspace-angular-dist_deploy:
306 + if: ${{ github.event_name != 'pull_request' }}
307 + runs-on: ubuntu-latest
308 + needs:
309 + # Requires manifest to be fully updated on DockerHub
310 + - dspace-angular-dist_manifest
311 + steps:
312 + - name: Redeploy sandbox.dspace.org (based on main branch)
313 + if: ${{ github.ref_name == github.event.repository.default_branch }}
314 + run: |
315 + curl -X POST -d '{}' $REDEPLOY_SANDBOX_URL
316 + env:
317 + REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
318 +
319 + - name: Redeploy demo.dspace.org (based on maintenace branch)
320 + if: ${{ github.ref_name == 'dspace-7_x' }}
321 + run: |
322 + curl -X POST -d '{}' $REDEPLOY_DEMO_URL
323 + env:
324 + REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut