From ccc344c8eeb95e59f90eca45b1867e11782e0dfa Mon Sep 17 00:00:00 2001 From: MajoBerger <88670521+MajoBerger@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:53:17 +0200 Subject: [PATCH] add redeploy to dev-5 -> curl call to deploy action --- .github/workflows/docker.yml | 67 ++++++------------------------------ 1 file changed, 10 insertions(+), 57 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5458a66d714..cf8578cdf43 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -89,60 +89,13 @@ jobs: # Use tags / labels provided by 'docker/metadata-action' above tags: ${{ steps.meta_build.outputs.tags }} labels: ${{ steps.meta_build.outputs.labels }} - - ############################################################# - # Build/Push the 'dspace/dspace-angular' image ('-dist' tag) - ############################################################# - dspace-angular-dist: - # Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular' - if: github.repository == 'dspace/dspace-angular' - runs-on: ubuntu-latest - - steps: - # https://github.com/actions/checkout - - name: Checkout codebase - uses: actions/checkout@v3 - - # https://github.com/docker/setup-buildx-action - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - - # https://github.com/docker/setup-qemu-action - - name: Set up QEMU emulation to build for multiple architectures - uses: docker/setup-qemu-action@v2 - - # https://github.com/docker/login-action - - name: Login to DockerHub - # Only login if not a PR, as PRs only trigger a Docker build and not a push - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - # https://github.com/docker/metadata-action - # Get Metadata for docker_build_dist step below - - name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular-dist' image - id: meta_build_dist - uses: docker/metadata-action@v4 - with: - images: dspace/dspace-angular - tags: ${{ env.IMAGE_TAGS }} - # As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same - # tagging logic as the primary 'dspace/dspace-angular' image above. - flavor: ${{ env.TAGS_FLAVOR }} - suffix=-dist - - - name: Build and push 'dspace-angular-dist' image - id: docker_build_dist - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.dist - platforms: ${{ env.PLATFORMS }} - # For pull requests, we run the Docker build (to ensure no PR changes break the build), - # but we ONLY do an image push to DockerHub if it's NOT a PR - push: ${{ github.event_name != 'pull_request' }} - # Use tags / labels provided by 'docker/metadata-action' above - tags: ${{ steps.meta_build_dist.outputs.tags }} - labels: ${{ steps.meta_build_dist.outputs.labels }} + + - name: redeploy + if: '!cancelled()' + run: | + curl -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \ + --request POST \ + https://api.github.com/repos/dataquest-dev/\ + dspace-angular/actions/workflows/deploy.yml/dispatches \ + --data "{\"ref\":\"refs/heads/dtq-dev-7.5\"}