Skip to content

Commit fd64545

Browse files
committed
Trigger redeploy of demo/sandbox from GitHub Actions after DockerHub image updated.
1 parent 9f12ca3 commit fd64545

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/docker.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ env:
2323
# For a new commit on other branches, use the branch name as the tag for Docker image.
2424
# For a new tag, copy that tag name as the tag for Docker image.
2525
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 }}
2828
type=ref,event=tag
2929
# Define default tag "flavor" for docker/metadata-action per
3030
# https://github.com/docker/metadata-action#flavor-input
@@ -300,3 +300,25 @@ jobs:
300300
- name: Inspect image
301301
run: |
302302
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 }}

0 commit comments

Comments
 (0)