GitHub Actions to release odoc documentation to GitHub Pages?

Hi everyone!

Basically what’s in the title: I’m working on a library and I would like to have a GitHub Actions workflow build the docs for my library and push them to a GitHub Pages website.

I’ve looked at some other repos and couldn’t find anything of the like. Is there an existing Action I’m not aware of? Is there another workflow I don’t know?

Thanks for your help!

2 Likes

I’ve built a functioning workflow, but I’m still wondering if this is the most elegant way of doing it.

It runs dune build @doc and then uses a “Deploy to GitHub Pages” action I found to push the build folder onto a gh-pages branch in my repo.

I’m using kind of the same workflow.

I setup a demo repo where my students send homework in OCaml. The compilation of documentation happens in one action, but upload requires specific rights, so it happens in another action. Because of that, I think that it doesn’t worth creating a single action which will build documentation and upload it instantly.

setup-ocaml recently gained that feature!

2 Likes

Awesome, I was sure I wasn’t the first one to have that sort of use-case!