Generate plots from GitHub Pages

I’d like to have a GitHub repository that includes the ability to display plots of some data in the repo. Each time the data is updated, the plots are updated.

One way would be to use Google Charts embedded in Markdown. Unfortunately, these are generated every time the page is viewed (not cached AFAICT), they’re not very pretty, the Charts code is very cumbersome.

Another way would be to use GitHub Actions to run the Python to generate the plots and the static HTML and push it out to GitHub pages.

Does anyone have any (simple) examples of this? Or other suggestions for achieving a similar result?

Rob

If you are working with Jupyter Notebooks, then you can have your Actions run nbconvert --execute to re-run the notebook with new data. This would be converted to HTML and then could be pushed to GitHub Pages.

Another option, if you have a more complicated Pages site, is to use jekyllnb to convert to Jekyll and integrate the markdown files it created into that site.

I’m sure I’ve read of examples like these, but can’t find them at the moment.

Thanks for the reply.

I think the best solution is going to be to use ReadTheDocs and the Sphinx extensions to support MatPlotLib.