Fix documentation workflow always trying to commit

Don't try to commit and push if there is nothing to commit, because git will exit with 1, failing the workflow.
A continuation of ca6b87d05e9718b2a1e15835e6ad89ea15088abe.