This GitHub Action automates the process of building a table for an out-of-the-box documentation website full-text search powered by SQLite Cloud.
- Easy setup and configuration
- Seamless integration with your documentation website
- Utilizes the power of SQLite Cloud for efficient full-text search
To use this GitHub Action, follow these steps:
- Create a new workflow file (e.g.,
.github/workflows/docsearch.yml
) in your repository. - Add the following code to the workflow file:
name: Documentation Search
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build SQLite Cloud database
uses: sqlitecloud/docsearch-action@v4
with:
project-string: ${{ secrets.PROJECT_STRING }}
base-url: https://your-website.com/docs/
path: path/to/your/docs
database: my-docs-search
- Make sure you have a project on SQLite Cloud. If not, sign up for an account and create one.
- Add the Project Connection String as a secret in your repository settings, named
PROJECT_STRING
. - Create a database in your SQLite Cloud project and write its name in the
database
input of the action. - Customize these inputs according to your needs.
- The
base-url
represents the common part of your documentation URL. - If the
path
input is not specified, the workflow will recursively search for every .md or .mdx file starting from the root folder. - Set the
strip-html
input totrue
if you want to remove HTML elements. - Set the
strip-jsx
input totrue
if you want to remove JSX elements. - Set the
strip-md-titles
input totrue
if you want to remove markdown titles to avoid redundancy in the search. - Set the
use-front-matter
input totrue
if you want to move the front matter to thedocumentation
table as a JSON Object. - Set the
path-using-slug
input totrue
if you want to use the slug in the header as the path instead of the relative one for the URL.
- The
- Commit and push the workflow file to your repository.
Now, whenever you push changes to the main
branch, the GitHub Action will automatically update the table for your documentation website's full-text search using SQLite Cloud.
You can also use our docbuilder from the src
folder locally! Just compile it with your preferred compiler (don't forget to link libraries) and run it without any arguments, it will show you instructions on how to use it! By running it locally you can choose between printing sql to a file or building an SQLite database file.
For more information and advanced configuration options, please refer to this article SQLite Cloud Blog.