Add PR preview pruning and retention management
Description
This PR adds preview pruning and retention management for PR preview deployments.
What changed
- Adds PREVIEW_RETENTION_LIMIT = 6
- Implements pruning of old
pr-preview/pr-*directories - Uses sparse checkout for efficient gh-pages maintenance
- Ensures only 6 most recent previews are kept
- Adds notifications when previews are pruned
- Preserves cleanup-on-close behavior
Issue
Fixes #377
Notes for Reviewers
- Workflow runs after PR preview deployment
- Only gh-pages
pr-previewdirectory is modified - Safe for concurrent PR workflows
Checklist
- [x] I tested the workflow locally / validated syntax
- [x] I understand this modifies GitHub Actions behavior
Signed commits
- [x] Yes, I signed my commits
🚀 Preview deployment: https://layer5io.github.io/getnighthawk/pr-preview/pr-378/
Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here
Hi maintainers 👋
This PR implements preview pruning and retention management as per #377.
Ready for review when convenient.
Hi maintainers 👋
I noticed the failing lint check appears to be timing out during package loading (context deadline exceeded).
This PR only modifies build-and-preview-site.yml and docs/_data/discuss/nighthawk.json, and does not modify .github/workflows/ci.yml, which runs the lint job.
Please let me know if you'd like any changes from my side or if there is anything else I can help investigate.
Thanks! 🙌
I approved this PR by mistake.
@Sbragul26 Thanks for the review! I've updated the workflow by replacing git push || true with git push as suggested. Please take another look when you have a chance.
Hi @Sbragul26, @Bhumikagarggg,
Just following up on this PR. I've addressed all the requested review comments, and the PR now has no merge conflicts and an approval. The remaining failing lint check appears to be unrelated to the changes in this PR.
Could you please let me know if anything else is required from my side? If everything looks good, I'd really appreciate it if this PR could be merged when you have time. Thank you!
Hi @Sbragul26, @Bhumikagarggg, @banana-three-join, @hortison 👋
Just a friendly follow-up on this PR. I've addressed all the requested review comments, the PR has an approval, and there are no merge conflicts. The remaining lint check appears to be unrelated to the changes in this PR.
If everything looks good, I'd really appreciate it if you could take a final look and merge it when you have time. Please let me know if there's anything else you'd like me to update.
Thank you!