Closed LesnyRumcajs closed 1 month ago
Other big rust projects must face this issue - I'll have a look at how e.g servo addresses this
Known issue: https://www.reddit.com/r/rust/comments/wy3j50/psa_if_youre_using_ghpages_to_host_your/
As a first-step measure, we changed the CI script to overwrite the gh-pages branch at every run, rather than just appending a new commit. We use this gh-pages action, so it was just a matter of adding a force_orphan: true parameter.
Turns out that this improved the situation a lot: when it no longer needs to keep history, git manages to compress that 220MB of documentation very well, and now the whole Smithay git repo is only ~15 MB!
We currently use JamesIves/github-pages-deploy-action
, which looks like it commits to a gh-pages
branch?
https://github.com/ChainSafe/forest/blob/b7ac40354c713ef2e087a6e4c1f0c59c61a28bef/.github/workflows/docs.yml#L81-L87
Maybe switching to actions/deploy-pages
would be better, or maybe the fork mentioned in the reddit thread
I would suggest exploring using Cloudflare pages for this, as well as pruning the git history. Cloning the full repo sucks 😁
Issue summary
Self-hosting Rust docs makes regular Forest clones/forks quite heavy; 419 MB for latest
main
b7ac40354c713ef2e087a6e4c1f0c59c61a28bef.The largest culprit is the Rust documentation.
Use this command
Sample output:
This is too large and must be dealt with.
gh-pages
branch - most likely it will need to be squashed (or re-created) so that the objects are no longer present in git history,Other information and links