Skip to content

Commit

Permalink
feat: doc content re algolia scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuafernandes committed Jun 7, 2023
1 parent 6b60e17 commit eab16e9
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 28 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/algolia-search-scraper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Algolia Search Scraper

on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:

jobs:
build:
name: Trigger Algolia Scraper
runs-on: ubuntu-22.04
environment: algolia
strategy:
fail-fast: false
matrix:
version:
[
"docs",
]
steps:
- uses: actions/checkout@v3
- id: config
name: Read ${{ matrix.version }}.json
shell: bash
run: |
content=$(cat ./.github/config/${{ matrix.version }}.json | jq -r tostring)
echo "configJSON=$content" >> $GITHUB_OUTPUT
- name: Checkout algolia/docsearch-scraper
uses: actions/checkout@v3
with:
repository: algolia/docsearch-scraper
path: "./algolia"
- name: Set up Python
uses: actions/setup-python@v4.5.0
with:
python-version: "3.6"
- name: Install pipenv
shell: bash
run: |
pip install pipenv
- name: pipenv Pipfile
shell: bash
run: |
cd ./algolia
pipenv install
- name: run algolia
shell: bash
env:
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
API_KEY: ${{ secrets.API_KEY }}
CONFIG: ${{ steps.config.outputs.configJSON }}
run: |
cd ./algolia/scraper
pipenv run python -m src.index
2 changes: 2 additions & 0 deletions docs/advanced/enabling-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const config = {
};
```

Add the [algolia-search-scraper](../../.github/workflows/algolia-search-scraper.yml) to your repo and include an environment 'algolia' with secrets for APPLICATION_ID and API_KEY. Edit the `docs` index in the file to match your repo's index in Algolia. This workflow will run in the background and populate the index that algolia uses to search.

## Source code is not open-source

Unfortunately, if your project does not satisfy the [checklist](https://docsearch.algolia.com/docs/who-can-apply/) then we cannot use Algolia (for free).
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/understanding-repo-layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Used by [`npm`](https://docs.npmjs.com/cli/v9/configuring-npm/package-json) cont

## 📖 `project-words.txt`

Used by `CSpell` in the `.cspell.json` configuration file with additional project words that should not be flagged as misspelling when linting.
Used by `CSpell` in the `.cspell.json` configuration file with additional project words that should not be flagged as misspelling when linting. Please add your project words here periodically as this is the master file that all repos use.

## 🦖 `sidebars.js`

Expand Down
Loading

0 comments on commit eab16e9

Please sign in to comment.