Skip to content
book-open

GitHub Action

Docs as Code - Confluence

v3.2.2 Latest version

Docs as Code - Confluence

book-open

Docs as Code - Confluence

Publish the content of a folder to confluence

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Docs as Code - Confluence

uses: Bhacaz/[email protected]

Learn more about this action in Bhacaz/docs-as-code-confluence

Choose a version

Docs as Code - Confluence

Publish a folder of documentation to Confluence.

Create a Confluence Page for each markdown file. Each folder will create a parent page to reflect the directory structure.

Parameters

Name Description Required
folder The folder to sync true
username Confluence username or email true
password Confluence password or API token true
confluence-base-url Your Confluence URL (with wiki). Example: https://mydomain.atlassian.net/wiki true
space-key Confluence space key to publish the documentation. Located after spaces in the URL. https://mydomain.atlassian.net/wiki/spaces/<<~1234>>.
Or in Space settings > Space details > Key.
true
parent-page-id Page id under which the documentation will be published. Located after pages in the URL. https://mydomain.atlassian.net/wiki/spaces/~1234/pages/<<1234>>/My+Parent+Page true

TODO

  • Renaming a file
  • Moving/Removing a file
  • Not updating Confluence pages when there is no change
  • Add commit link to the new page version
  • Add markdown images with url source

Example of workflow

name: Sync Docs as Code - Confluence
on:
  push:
    branches:
      - main
    paths:
      - 'docs/**'
jobs:
  docs-as-code:
    runs-on: ubuntu-latest
    name: Sync Docs as Code - Confluence
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Sync Docs as Code - Confluence
        uses: Bhacaz/docs-as-code-confluence@v3
        with:
          folder: docs
          username: [email protected]
          password: ${{ secrets.API_TOKEN }}
          confluence-base-url: https://mydomain.atlassian.net/wiki
          space-key: ~1234
          parent-page-id: 123456789

Example of usage in a repository

Bhacaz/docs-as-code-confluence-demo

Development

Test

npm run test

Build

npm run build