1
0
mirror of synced 2026-08-06 02:08:01 +00:00

rework the search indexing process

- reconfigure the docsearch scraper to store component and version for each res
- switch from the Docker image to a resuable GitHub Action
- add publish-docsearch-config extension to transform Handlebars into YAML
This commit is contained in:
Dan Allen
2022-12-21 12:57:51 -07:00
committed by Marcus Hert Da Coregio
parent 2fb91e6266
commit 409bd29abd
8 changed files with 159 additions and 47 deletions
+16 -3
View File
@@ -8,8 +8,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Run Docsearch Scraper
run: $GITHUB_WORKSPACE/.github/actions/algolia-docsearch-scraper.sh "${{ secrets.ALGOLIA_APPLICATION_ID }}" "${{ secrets.ALGOLIA_WRITE_API_KEY }}" $GITHUB_WORKSPACE/.github/actions/algolia-config.json
- name: Configure Indexer
run: |
CONFIG_FILE=.github/actions/docsearch-config.json
if [ ! -f $CONFIG_FILE ]; then
curl -sL -o $CONFIG_FILE $(node -p "require('fs').readFileSync('antora-playbook.yml', 'utf8').match(/^ url: (.*)/m)[1]")/docsearch-config.json
fi
INDEX_NAME=$(node -p "JSON.parse(require('fs').readFileSync('$CONFIG_FILE')).index_name")
echo "CONFIG_FILE=${CONFIG_FILE}" >> $GITHUB_ENV
echo "INDEX_NAME_TMP=${INDEX_NAME}-${GITHUB_RUN_ID}" >> $GITHUB_ENV
- name: Run Indexer
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: ${{ secrets.ALGOLIA_APP_ID }}
algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }}
file: ${{ env.CONFIG_FILE }}