Add dependencies #394
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: main | |
| on: | |
| push: | |
| branches: [ main, master, ci_test ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13.3' | |
| architecture: x64 | |
| - name: Install all dependencies | |
| run: | | |
| python -m pip install --upgrade pipenv | |
| python -m pip install --upgrade 'algoliasearch>=4.0,<5.0' | |
| sudo apt-get update | |
| sudo apt-get install -y libxml2-dev libxslt1-dev python3-dev | |
| - name: Clone algolia repository | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: algolia/docsearch-scraper | |
| path: algolia | |
| - name: Prepare the algolia | |
| run: | | |
| mv algolia/.env.example algolia/.env | |
| echo { > algolia/config.json | |
| echo \"index_name\": \"hardwario\", >> algolia/config.json | |
| echo \"start_urls\": [ >> algolia/config.json | |
| echo \"https://docs.hardwario.com/\" >> algolia/config.json | |
| echo ], >> algolia/config.json | |
| echo \"stop_urls\": [], >> algolia/config.json | |
| echo \"selectors\": { >> algolia/config.json | |
| echo \"lvl0\": \"h1\", >> algolia/config.json | |
| echo \"lvl1\": \"h2\", >> algolia/config.json | |
| echo \"lvl2\": \"h3\", >> algolia/config.json | |
| echo \"lvl3\": \"h4\", >> algolia/config.json | |
| echo \"lvl4\": \"h5\", >> algolia/config.json | |
| echo \"lvl5\": \"h6\", >> algolia/config.json | |
| echo \"text\": \"p, li\" >> algolia/config.json | |
| echo } >> algolia/config.json | |
| echo } >> algolia/config.json | |
| sed -r -i'' 's/APPLICATION_ID=/APPLICATION_ID=AKRT8SVTPP/' algolia/.env | |
| sed -r -i'' 's/API_KEY=/API_KEY=${{ secrets.API_KEY }}/' algolia/.env | |
| - name: Delete Old Index | |
| run: | | |
| echo "from algoliasearch.search.client import SearchClient" > deleteIndex.py | |
| echo "client = SearchClient(\"AKRT8SVTPP\", \"${{ secrets.API_KEY }}\")" >> deleteIndex.py | |
| echo "client.clear_objects(\"hardwario\")" >> deleteIndex.py | |
| echo "print(\"Deleted records.\")" >> deleteIndex.py | |
| python deleteIndex.py | |
| - name: Build The Index | |
| run: | | |
| chmod +x algolia/docsearch | |
| cd algolia ; pipenv install --python $(which python) ; pipenv run ./docsearch run config.json |