github-actions: build search index during the doc sync (#5224)

* github-actions: build search index during the doc sync

Signed-off-by: Artem Navoiev <tenmozes@gmail.com>

---------

Signed-off-by: Artem Navoiev <tenmozes@gmail.com>
This commit is contained in:
Artem Navoiev 2023-10-21 12:08:32 -07:00 committed by GitHub
parent 33484d3365
commit 3e0236b4a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,8 @@ on:
paths: paths:
- 'docs/**' - 'docs/**'
workflow_dispatch: {} workflow_dispatch: {}
env:
PAGEFIND_VERSION: "1.0.3"
permissions: permissions:
contents: read # This is required for actions/checkout and to commit back image update contents: read # This is required for actions/checkout and to commit back image update
deployments: write deployments: write
@ -24,7 +26,16 @@ jobs:
repository: VictoriaMetrics/vmdocs repository: VictoriaMetrics/vmdocs
token: ${{ secrets.VM_BOT_GH_TOKEN }} token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: docs 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 - name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5 uses: crazy-max/ghaction-import-gpg@v5
with: with:
@ -45,6 +56,7 @@ jobs:
rm -rf content rm -rf content
cp -r ../main/docs content cp -r ../main/docs content
make clean-after-copy make clean-after-copy
make build-search-index
git config --global user.name "${{ steps.import-gpg.outputs.email }}" git config --global user.name "${{ steps.import-gpg.outputs.email }}"
git config --global user.email "${{ steps.import-gpg.outputs.email }}" git config --global user.email "${{ steps.import-gpg.outputs.email }}"
git add . git add .