Skip to main content

Our Docusaurus publishing workflow

· 3 min read
Stephan Hochdörfer
Head of IT Business Operations

As said before, we are still happy with Docusaurus as our blogging platform. However, Docusaurus being a static page generator, it comes with a few challenges in regard to scheduling and publishing blog posts.

This might not be an issue for you if you are not a frequent blogger. In our case, we publish a new blog post at least once a week and have posts scheduled for the next 4 to 6 weeks. In an ideal world, the publishing process would be fully automated, but that's currently not the case.

Right now, our publishing workflow works like this: We create a branch in git for every blog post we want to publish and out of that create a Merge Request in our GitLab instance as you see here:

Merge Requests for blog posts

As you can see, the Merge Request name contains the blog post title as well as the publication date. Since it is not possible to assign a date to a Merge Request in GitLab, this seemed the best way to keep track of when to publish which blog post. Additionally, we flag the Merge Requests as drafts to not accidentally merge them. Docusaurus does not care when a blog post should be published. What is merged on the master branch will get published. This makes the whole situation a bit more complicated than needed.

Additionally, I keep track of the publication dates in my personal to-do list to not miss publishing a blog post. When a blog post needs to be published, the draft flag gets removed, it is merged to master, and then a Git tag is created to kick off the build process. This will trigger a staging deployment which is followed by manually triggering the production deployment.

Deployment pipeline for Docusaurus

In general, the process is "ok", it just gets a bit annoying when we need to reschedule blog posts. That process involves a Git commit with the new date, the Merge Request title needs to be adapted and I need to update my to-do list task with the new date.

I am still looking for a more automated publishing workflow, maybe some cronjob that checks the Merge Requests and merges them automatically but since we have to keep track of the publishing date either in the title or the description field of the Merge Request, I feel a bit uncomfortable about it as this could lead to the problems when parsing and interpreting the publication dates goes wrong.