Skip to content

Commit

Permalink
Added job to cleanup artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalazam committed Jun 24, 2023
1 parent 21fa3a5 commit 8d2da2b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/actions/deploy-to-gh-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
UPLOADED_ARTIFACTS_DIR:
required: true
description: 'Uploads artifacts directory'
SITE_DIR:
required: true
description: 'Directory containing the contents of the site'
MODULE_DIR:
required: true
description: 'Directory containing the module code'
Expand Down
1 change: 0 additions & 1 deletion .github/actions/generate-reports/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ runs:
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.UPLOADED_ARTIFACTS_DIR }}
retention-days: 1
path: ${{ inputs.MODULE_DIR }}/target
1 change: 0 additions & 1 deletion .github/actions/run-tests-and-upload-results/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ runs:
uses: actions/upload-artifact@v3
with:
name: ${{ env.UPLOAD_DIR }}
retention-days: 1
path: ${{ inputs.MODULE_DIR }}/target
15 changes: 13 additions & 2 deletions .github/workflows/parent-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}
retention-days: 1
path: target-staging

deploy-to-gh-pages:
Expand All @@ -74,4 +73,16 @@ jobs:
with:
folder: ${{ env.UPLOADED_ARTIFACTS_DIR }}
# to push the contents of the deployment folder into a specific directory on the deployment branch
clean-exclude: INDIVIDUAL_MODULES
clean-exclude: INDIVIDUAL_MODULES

cleanup:
name: 'Cleanup actions'
needs:
- deploy-to-gh-pages
runs-on: ubuntu-latest
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}*
failOnError: false
16 changes: 13 additions & 3 deletions .github/workflows/putting-all-together.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}
retention-days: 1
path: ${{ env.TARGET_DIR }}

generate-project-site:
Expand Down Expand Up @@ -150,7 +149,6 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}
retention-days: 1
path: 'site/badges/jacoco'

deploy-to-gh-pages:
Expand Down Expand Up @@ -182,4 +180,16 @@ jobs:
uses: './.github/workflows/deploy.yml'
with:
JAVA_VERSION_TO_INSTALL: ${{ needs.setup-env.outputs.JAVA_VERSION }}
MODULE_DIR: ${{ needs.setup-env.outputs.MODULE_DIR }}
MODULE_DIR: ${{ needs.setup-env.outputs.MODULE_DIR }}

cleanup:
name: 'Cleanup actions'
needs:
- deploy-to-gh-pages
runs-on: ubuntu-latest
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}*
failOnError: false
14 changes: 13 additions & 1 deletion .github/workflows/site-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,16 @@ jobs:
JAVA_VERSION_TO_INSTALL: ${{ env.JAVA_VERSION }}
UPLOADED_ARTIFACTS_DIR: ${{ env.UPLOADED_ARTIFACTS_DIR }}
MODULE_DIR: ${{ env.MODULE_DIR }}
SITE_DIR: ${{ env.SITE_DIR }}
SITE_DIR: ${{ env.SITE_DIR }}

cleanup:
name: 'Cleanup actions'
needs:
- deploy-to-gh-pages
runs-on: ubuntu-latest
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ env.UPLOADED_ARTIFACTS_DIR }}*
failOnError: false

0 comments on commit 8d2da2b

Please sign in to comment.