1. Manual workflows
  2. GitHub Auto-Publish

Use this workflow when your docs live in GitHub and you want Docsalot to publish changes as soon as they are merged into main.

​
What this workflow does

  1. Listens for changes in your docs folder on main.
  2. Authenticates the Docsalot CLI in CI.
  3. Creates a new version with docsalot docs push.
  4. Publishes the latest version immediately with docsalot docs publish.

​
Step 1: Add repository secrets

In your GitHub repository, add:

  • DOCSALOT_API_TOKEN: API token for a Docsalot user or service account.
  • DOCSALOT_DOCUMENTATION_ID: The target docs project ID.

You can find the documentation ID with:

docsalot docs list --json

​
Step 2: Create the workflow

Create .github/workflows/docsalot-publish.yml:

name: Docsalot Auto Publish

on:
  push:
    branches: [main]
    paths:
      - "docsalot-docs/**"
  workflow_dispatch:

concurrency:
  group: docsalot-publish-${{ github.ref }}
  cancel-in-progress: true

jobs:
  publish:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    env:
      DOCSALOT_DOCUMENTATION_ID: ${{ secrets.DOCSALOT_DOCUMENTATION_ID }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Install Docsalot CLI
        run: npm install -g docsalot-cli

      - name: Authenticate
        run: echo "${{ secrets.DOCSALOT_API_TOKEN }}" | docsalot auth login --from-stdin

      - name: Push docs update (creates a new version)
        run: |
          docsalot docs push \
            --documentation-id "$DOCSALOT_DOCUMENTATION_ID" \
            --dir docsalot-docs \
            --message "ci: docs update ${GITHUB_SHA}"

      - name: Publish latest version
        run: |
          docsalot docs publish \
            --documentation-id "$DOCSALOT_DOCUMENTATION_ID"

​
Fast publish recommendations

  • Keep the paths filter narrow so the workflow only runs for docs changes.
  • Use concurrency with cancel-in-progress: true to avoid stale publish jobs.
  • Keep docs changes in focused pull requests to reduce unnecessary version churn.
  • Keep commit messages clear so publish history is easy to audit.

​
Verify after first run

  1. Merge a docs change into main.
  2. Confirm the workflow succeeds in GitHub Actions.
  3. Open your Docsalot site URL and verify the update is live.