Build documentation with graphics locally or on github

One of my packages renders graphics into the documentation using @example. This works flawlessly on my local machine but causes errors during CI on github.

Because the github servers are headless I need to load software gpu emulation libraries. These libraries seem to change randomly every few months which causes the documentation build to fail. Then I have to go find the latest GPU emulation libraries to fix it.

What is recommended practice in the case where documentation graphics are rendered each time the docs are created? Is it okay to create the docs locally and then push them up to github? Or is there a more reliable set of software GPU emulation libraries that I can count on to work in CI for years, not months?

We almost never change the code for xvfb setup in the Makie docs CI, you can check git blame how often it changes. And cairomakie always works on CI. Not sure which plotting packages you were asking about.