0
votes

I have a public GitHub repository consisting primarily of LaTeX that I compile into a set of PDFs, using a Makefile that's also in the repository. I'd like to expand this project with a website that, hopefully, would also include the PDF files. Ideally, I'd like to run this website using GitHub Pages.

The most common way to do something like this (used by Jekyll Action, GitHub Pages Deploy and others), seems to be to use a GitHub Action to compile the documents, and then push the compiled documents themselves to the gh-pages branch. However, my understanding is that repeatedly pushing PDFs (binary files) will take up a lot of space. The full set of PDFs created by the repository is already over a megabyte, and will only keep growing. I could see this soon exceeding GitHub's 1 GB repository limit.

However, GitHub seems to intentionally, and understandably, prevent Jekyll from executing arbitrary code as part of the process of building the website. So doing it as part of the usual website deployment, without using Actions, seems infeasible.

Is there a way to host the latest version of a compiled PDF on GitHub Pages without blowing out storage limits?

1

1 Answers

0
votes

By forcing a push of a new, orphan gh-pages branch each time, the gh-pages branch only ever has one commit, and storage space won't accumulate. In essence, it isn't version controlled at all.

There are existing GitHub Actions that perform pushes this way. This one offers an option (keep_history) to perform the pushes either way, version controlling gh-pages or leaving it with only one commit at a time.