Kembali ke Papan Pemuka

Dokumentasi

Ketahui cara menggunakan Asyntai

GitHub Actions Integration

Send your documentation to your chatbot on every push

Create Account

Overview

Your documentation lives in a Git repository. Your chatbot answers from the Asyntai knowledge base. The Asyntai Knowledge Sync action keeps the two the same.

Merge a pull request that changes a page, and the chatbot answers from the new page. Your writers keep their normal workflow, and your visitors get the current answer.

How It Works

The action runs as one step in your workflow. It reads the files you point it at, compares them with your knowledge base, and sends what changed.

  • A new file becomes a new knowledge base entry.
  • A changed file replaces its entry.
  • A file with the same text is left alone, so a run costs nothing against your daily limit.
  • With prune on, an entry whose file is gone is removed.

The entry title is the file path, so you can find every page in Knowledge Base in your dashboard. Each run writes a table into the GitHub job summary.

Requirements

  • A GitHub repository with GitHub Actions turned on
  • An Asyntai account on the Starter plan or higher, because the action uses the Asyntai API

Installation

Follow these steps to add the action to your repository:

1

Get Your API Key

Sign in to Asyntai, open Settings, then API, and copy your API key.

2

Add a Repository Secret

In GitHub, open Settings → Secrets and variables → Actions, press New repository secret, and name it ASYNTAI_API_KEY. Paste your key as the value.

3

Add the Workflow

Create the file .github/workflows/asyntai.yml with this content:

name: Sync docs to Asyntai

on:
  push:
    branches: [main]
    paths: ['docs/**']

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: asyntai/knowledge-sync-action@v1
        with:
          api-key: ${{ secrets.ASYNTAI_API_KEY }}
          files: 'docs/**/*.md'
4

Push and Watch

Push the workflow. Open the Actions tab and open the run. The summary shows how many entries the run added, replaced, or left alone.

Settings

Input Default What it does
api-keyrequiredYour Asyntai API key. Always pass it from a secret.
filesdocs/**/*.mdGlob patterns, one per line. * and ? stay inside one path segment. ** crosses directories.
website-idemptyWhich website to fill. Empty means the primary website of the account.
title-prefixemptyText put in front of every entry title. Use it when several repositories feed one chatbot.
prunefalseDelete entries whose file is gone. Needs title-prefix.
dry-runfalseReport the changes and send nothing.

Several Repositories, One Chatbot

Give each repository its own title-prefix, for example product-docs/ and handbook/. Then turn prune on. Each workflow only touches the entries that carry its own prefix.

- uses: asyntai/knowledge-sync-action@v1
  with:
    api-key: ${{ secrets.ASYNTAI_API_KEY }}
    files: |
      docs/**/*.md
      handbook/**/*.md
      CHANGELOG.md
    title-prefix: 'product-docs/'
    prune: true

Tip: Run the action with dry-run: true the first time. The job summary then lists every entry the run would create, and nothing is sent.

Front Matter

A leading YAML front matter block is removed before the text is sent, so the chatbot answers from the prose and not from the metadata keys. This suits Docusaurus, Jekyll, Hugo, MkDocs and VitePress.

Removing It

Delete the workflow file. Your knowledge base entries stay as they are. To clear them, open Knowledge Base in your dashboard and delete the entries, or run the action once more with prune: true after you remove the files.

Plans & Pricing

The action is free. It uses the Asyntai API, which needs the Starter plan or higher. View pricing.

Need Help?

If you have any questions or run into issues, contact us at [email protected].