Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/scripts/remove_oldest_report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ -d "gh-pages/$REPORT_NAME" ]; then
cd gh-pages/$REPORT_NAME
# Find the oldest numerical directory
oldest_dir=$(find . -maxdepth 1 -type d -regex './[0-9]+' | sort -n | head -1)
if [ -n "$oldest_dir" ]; then
echo "Removing oldest report directory: $oldest_dir"
rm -rf "$oldest_dir"
else
echo "No report directories found to remove"
fi
cd ../../
else
echo "Report directory does not exist yet"
fi
6 changes: 6 additions & 0 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
path: gh-pages
repository: ${{vars.GH_PAGES}}
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Remove oldest report to save space
if: ${{success()}}
run: |
chmod +x .github/scripts/remove_oldest_report.sh
.github/scripts/remove_oldest_report.sh

- name: Register report
id: register-project
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
workflow_run:
workflows: ["Build and deploy GovTool test stack"]
types: [completed]
branches:
branches:
- test
- infra/test-chores

Expand Down Expand Up @@ -153,12 +153,19 @@ jobs:
repository: ${{vars.GH_PAGES}}
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Remove oldest report to save space
if: ${{success()}}
run: |
chmod +x .github/scripts/remove_oldest_report.sh
.github/scripts/remove_oldest_report.sh

- name: Register report
id: register-project
if: ${{success()}}
run: |
chmod +x .github/scripts/register_report.sh
.github/scripts/register_report.sh

- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down