diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 440f591..e17a98f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,8 +40,8 @@ jobs: name: Algolia updates runs-on: ubuntu-latest env: - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }} + API_KEY: ${{ secrets.ALGOLIA_API_KEY }} ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }} steps: - name: Checkout code @@ -49,4 +49,4 @@ jobs: - name: Run Docker image run: | - docker run hello-world:latest \ No newline at end of file + docker run -it -e APPLICATION_ID=$APPLICATION_ID -e API_KEY=$API_KEY -e "CONFIG=$(cat algolia_config.json | jq -r tostring)" algolia/docsearch-scraper \ No newline at end of file diff --git a/algolia_config.json b/algolia_config.json new file mode 100644 index 0000000..06b40d7 --- /dev/null +++ b/algolia_config.json @@ -0,0 +1,48 @@ +{ + "index_name": "prod_akmalov", + "start_urls": [ + "https://akmalov.com/" + ], + "sitemap_urls": [ + "https://akmalov.com/sitemap.xml" + ], + "sitemap_alternate_links": true, + "stop_urls": [], + "selectors": { + "lvl0": { + "selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]", + "type": "xpath", + "global": true, + "default_value": "Documentation" + }, + "lvl1": "header h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5, article td:first-child", + "lvl6": "article h6", + "text": "article p, article li, article td:last-child" + }, + "strip_chars": " .,;:#", + "custom_settings": { + "separatorsToIndex": "_", + "attributesForFaceting": [ + "language", + "version", + "type", + "docusaurus_tag" + ], + "attributesToRetrieve": [ + "hierarchy", + "content", + "anchor", + "url", + "url_without_anchor", + "type" + ] + }, + "conversation_id": [ + "833762294" + ], + "nb_hits": 9510 +}