From ba5e462a2c6e5e19ef3d780733a568f4549fa44b Mon Sep 17 00:00:00 2001 From: MajoBerger <88670521+MajoBerger@users.noreply.github.com> Date: Fri, 23 Feb 2024 08:35:12 +0100 Subject: [PATCH] Internal/rework actions (#523) * no longer needed gh action * deploy after images not working * five is five! * corrected indent * removed unused action * is it plane? is it duck? is it string? * same repo needs other syntax? * run, not runs * this if is wrong * just inputs, not github.event.inputs * correct inputs to gh actions * full build and fixed deploy.yml * last polish * final v2 --- .github/workflows/build.yml | 56 +++++++++++++++++------------------ .github/workflows/deploy.yml | 8 ++--- .github/workflows/docker.yml | 3 ++ .github/workflows/reindex.yml | 14 --------- 4 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/reindex.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88e603088fc..a71e1a0e031 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -188,31 +188,31 @@ jobs: - name: Shutdown Docker containers run: docker-compose -f ./docker/docker-compose-ci.yml down - # Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test - # job above. This is necessary because Codecov uploads seem to randomly fail at times. - # See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 - codecov: - # Must run after 'tests' job above - needs: tests - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - # Download artifacts from previous 'tests' job - - name: Download coverage artifacts - uses: actions/download-artifact@v3 - - # Now attempt upload to Codecov using its action. - # NOTE: We use a retry action to retry the Codecov upload if it fails the first time. - # - # Retry action: https://github.com/marketplace/actions/retry-action - # Codecov action: https://github.com/codecov/codecov-action - - name: Upload coverage to Codecov.io - uses: Wandalen/wretry.action@v1.0.36 - with: - action: codecov/codecov-action@v3 - # Try upload 5 times max - attempt_limit: 5 - # Run again in 30 seconds - attempt_delay: 30000 +# # Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test +# # job above. This is necessary because Codecov uploads seem to randomly fail at times. +# # See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 +# codecov: +# # Must run after 'tests' job above +# needs: tests +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# # Download artifacts from previous 'tests' job +# - name: Download coverage artifacts +# uses: actions/download-artifact@v3 +# +# # Now attempt upload to Codecov using its action. +# # NOTE: We use a retry action to retry the Codecov upload if it fails the first time. +# # +# # Retry action: https://github.com/marketplace/actions/retry-action +# # Codecov action: https://github.com/codecov/codecov-action +# - name: Upload coverage to Codecov.io +# uses: Wandalen/wretry.action@v1.0.36 +# with: +# action: codecov/codecov-action@v3 +# # Try upload 5 times max +# attempt_limit: 5 +# # Run again in 30 seconds +# attempt_delay: 30000 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d0fcd4efb1c..9cf36f577cd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,8 +29,8 @@ on: type: boolean jobs: - deploy: - if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '5' + deploy-5: + if: inputs.INSTANCE == '*' || inputs.INSTANCE == '5' runs-on: dspace-dep-1 timeout-minutes: 5 env: @@ -45,7 +45,7 @@ jobs: ./start.sh dspace-$INSTANCE deploy-8: - if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8' + if: inputs.INSTANCE == '*' || inputs.INSTANCE == '8' runs-on: dspace-dep-1 timeout-minutes: 120 env: @@ -72,7 +72,7 @@ jobs: import-8: runs-on: dspace-dep-1 - if: github.event.inputs.IMPORT == 'true' + if: inputs.IMPORT == 'true' # shouldn't there also be if instance = 5? needs: deploy-8 env: INSTANCE: '8' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6263cfb8878..8d3e1542256 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -141,4 +141,7 @@ jobs: deploy: needs: docker uses: dataquest-dev/dspace-angular/.github/workflows/deploy.yml@dtq-dev + with: + INSTANCE: '5' + IMPORT: false secrets: inherit diff --git a/.github/workflows/reindex.yml b/.github/workflows/reindex.yml deleted file mode 100644 index 06aaa4d7aa3..00000000000 --- a/.github/workflows/reindex.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Reindex dev-5 -on: - workflow_dispatch: -jobs: - reindex: - runs-on: dspace-dep-1 - steps: - - uses: actions/checkout@v3 - - name: reindex everything - run: | - cd $GITHUB_WORKSPACE/build-scripts/run/ - pwd - ./reindex.sh - docker exec dspace /dspace/bin/dspace oai clean-cache