From 3e0236b4a337af736d7e24e8b1f62341f01107c8 Mon Sep 17 00:00:00 2001 From: Artem Navoiev Date: Sat, 21 Oct 2023 12:08:32 -0700 Subject: [PATCH] github-actions: build search index during the doc sync (#5224) * github-actions: build search index during the doc sync Signed-off-by: Artem Navoiev --------- Signed-off-by: Artem Navoiev --- .github/workflows/sync-docs.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 2f533b7d2..fbb389591 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -6,6 +6,8 @@ on: paths: - 'docs/**' workflow_dispatch: {} +env: + PAGEFIND_VERSION: "1.0.3" permissions: contents: read # This is required for actions/checkout and to commit back image update deployments: write @@ -24,7 +26,16 @@ jobs: repository: VictoriaMetrics/vmdocs token: ${{ secrets.VM_BOT_GH_TOKEN }} path: docs - + - uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + - name: Install PageFind #install the static search engine for index build + uses: supplypike/setup-bin@v3 + with: + uri: "https://github.com/CloudCannon/pagefind/releases/download/v${{env.PAGEFIND_VERSION}}/pagefind-v${{env.PAGEFIND_VERSION}}-x86_64-unknown-linux-musl.tar.gz" + name: "pagefind" + version: ${{env.PAGEFIND_VERSION}} - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v5 with: @@ -45,6 +56,7 @@ jobs: rm -rf content cp -r ../main/docs content make clean-after-copy + make build-search-index git config --global user.name "${{ steps.import-gpg.outputs.email }}" git config --global user.email "${{ steps.import-gpg.outputs.email }}" git add .