Skip to content

Commit

Permalink
chore(ci): index to meilisearch
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Mar 20, 2024
1 parent 2af8603 commit 39788c8
Show file tree
Hide file tree
Showing 4 changed files with 2,143 additions and 45 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/meilisearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: meilisearch

on:
workflow_dispatch: {}
workflow_run:
workflows: ["Deploy docs to netlify"]
types:
- completed

jobs:
indexing:
runs-on: ubuntu-latest
name: Indexing
steps:
- uses: actions/checkout@v4
with:
repository: 'meilisearch/scrapix'

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- run: yarn install

- run: yarn start -c "${SCRAPIX_CONFIG}"
env:
SCRAPIX_CONFIG: ${{ secrets.SCRAPIX_CONFIG }}
2 changes: 2 additions & 0 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"download-docs": "bash ../scripts/download-docs.sh",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"meili-scrape": "node ./scripts/meilisearch.js",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
Expand All @@ -20,6 +21,7 @@
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"@meilisearch/scrapix": "^0.1.7",
"clsx": "^1.2.1",
"meilisearch-docsearch": "^0.6.0",
"prism-react-renderer": "^1.3.5",
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/src/theme/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default function Component() {

const docsearch = require("meilisearch-docsearch").default;
const destroy = docsearch({
host: "HOST_VAR",
apiKey: "API_VAR",
indexUid: "docs-v1",
host: "http://localhost:7700",
apiKey: "xxx",
indexUid: "dev",
container: "#docsearch",
// searchParams: {filter: [`lang = ${lang}`]},
});
Expand Down
Loading

0 comments on commit 39788c8

Please sign in to comment.