CI: add a separate job for the documentation build
The pages job is only run once we push to main, so any issues with the documentation build won't be picked up until it's too late. Split those up and build the doc in a separate job, the pages job simply takes the artifacts from that job and publishes them.