|
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 |
@@ -300,3 +300,25 @@ jobs: |
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 }} |
0 commit comments