-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Algolia indexer Github Action and config. (#67)
* Add Algolia indexer Github Action and config. * Fix level 6 selector.
- Loading branch information
1 parent
1b34afa
commit 3b16a63
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: 'Update Algolia Search Results' | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
schedule: | ||
# The CRON duration for the job: At 2:30 AM UTC MON-FRI | ||
- cron: '30 2 * * 1-5' | ||
|
||
# permission can be added at job level or workflow level | ||
permissions: | ||
id-token: write | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get the content of algolia.json as config | ||
id: algolia_config | ||
run: echo "::set-output name=config::$(cat apps/base-docs/algolia.json | jq -r tostring)" | ||
- name: Push indices to Algolia | ||
uses: signcl/docsearch-scraper-action@master | ||
env: | ||
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} | ||
API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
CONFIG: ${{ steps.algolia_config.outputs.config }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"index_name": "prod", | ||
"start_urls": [ | ||
"https://docs.base.org" | ||
], | ||
"sitemap_urls": [ | ||
"https://docs.base.org/sitemap.xml" | ||
], | ||
"selectors": { | ||
"default": { | ||
"lvl0": "article h1", | ||
"lvl1": "article h2", | ||
"lvl2": "article h3", | ||
"lvl3": "article h4", | ||
"lvl4": "article h5", | ||
"lvl5": "article td:first-child", | ||
"lvl6": "article td:not(td:first-child)", | ||
"text": "article p, article li" | ||
} | ||
}, | ||
"strip_chars": " .,;:#" | ||
} |