- Manual workflows
- GitHub Auto-Publish
Manual workflows
GitHub Auto-Publish
Automatically create and publish a new docs version when docs files change.
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
- Listens for changes in your docs folder on
main. - Authenticates the Docsalot CLI in CI.
- Creates a new version with
docsalot docs push. - 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
pathsfilter narrow so the workflow only runs for docs changes. - Use
concurrencywithcancel-in-progress: trueto 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
- Merge a docs change into
main. - Confirm the workflow succeeds in GitHub Actions.
- Open your Docsalot site URL and verify the update is live.