[CI] Reduce repo size by auto-trimming gh-pages
branch
#11653
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
Use "force_orphan" option of GH action peaceiris/actions-gh-pages@v3
With this change, the API documentation that we generate as part of our CI will overwrite the
gh-pages
branch, only keeping the latest generated documentation. This will reduce the repository size (when cloned, from close to 3GB to ~150M.As a consequence, we will lose the history of API documentation. It will still be possible to manually generate it locally (yarn docs).
Fixes #11625
How to test
I pushed the change on my fork of this repo. See resulting
gh-pages
branch: https://github.com/marcdumais-work/theia/tree/gh-pages.You can also try cloning my fork, and confirm that about 150M is transferred, instead of ~2.8G:
$ git clone [email protected]:marcdumais-work/theia.git
update: it took a little while, but my repo size, as reported by GitHub, has shrunk to the expected, much smaller size, without further action on my part:
Generated doc (my fork): https://marcdumais-work.github.io/theia/docs/next/index.html
Review checklist
Reminder for reviewers