Docs-as-code for Confluence: publish a GitHub folder as searchable pages

Docs-as-code means keeping documentation as plain text files, such as Markdown, in the same Git repository as the code. The docs are written, reviewed and changed with the same tools as the code.

Many teams also want those docs in Confluence, where readers search and browse. Copies made by hand go out of date. This guide shows how to publish one folder of a public GitHub repository as ordinary Confluence pages.

The usual problems

A common way to show Markdown in Confluence is a macro that draws the file inside a page. The text appears, but it is not stored as page content, so:

Git Docs Sync for Confluence works differently. It writes real Confluence pages from the Markdown, so Confluence search, page history and page permissions apply to them. The app is a free beta on the Atlassian Marketplace, provided by AVIRA LLC.

Set up the sync

You need a Confluence Cloud site where you are a Confluence admin, and a public GitHub repository. No CI pipeline, API token or command-line tool is needed.

  1. Install Git Docs Sync for Confluence from the Atlassian Marketplace.
  2. In Atlassian Administration, go to Connected apps, open the ⋯ menu next to Git Docs Sync for Confluence, and select Configure.
  3. Fill in the settings and select Save.
  4. Select Sync now. When the sync finishes, the page shows its report.
Setting What to enter
GitHub repository (public) owner/name, or the repository's github.com address
Branch (empty = default branch) Leave empty to use the default branch
Folder (empty = repository root) The folder that holds your docs, such as docs
Confluence space key The key of the space that receives the pages, such as DOCS
Parent page id (empty = space home page) Optional. The number that identifies the page to publish under
Render Mermaid and PlantUML diagrams On by default
Schedule Off, Hourly or Daily

A few things to know:

To update the pages after you change the repository, select Sync now again, or let the schedule run it. Only pages whose content changed are updated, and no file gets a second page.

What gets converted

Limits

When a CLI is the better fit

If your team already runs CI and can store a Confluence API token, the free, open-source mark command-line tool from kovetskiy/mark may suit you better. It also creates real Confluence pages, and because it runs where your files are, it works for private repositories too. Git Docs Sync for Confluence needs no token, command line or pipeline, but it reads only public repositories.

Get help

For support or to report a security problem, email avirallcdev@gmail.com. The setup guide, privacy notice and end user terms are on this site.