From 88e43294e98a22436af7ae38aa0304d198e139ab Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Tue, 27 Jun 2023 14:12:29 +0100 Subject: [PATCH] docs: remove dupe doc reindexing (#760) seems like main runs anyway; so why run this? ## Description: `main` and `tag` both run on release; but main should be enough ## Is this change user facing? NO --- .github/workflows/reindex-website-main.yml | 24 +++++++++++++++++++ .github/workflows/reindex-website-release.yml | 17 ------------- 2 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 .github/workflows/reindex-website-release.yml diff --git a/.github/workflows/reindex-website-main.yml b/.github/workflows/reindex-website-main.yml index d2f5f6f34d..f2e377f51d 100644 --- a/.github/workflows/reindex-website-main.yml +++ b/.github/workflows/reindex-website-main.yml @@ -15,3 +15,27 @@ jobs: username: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} password: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} customHeaders: '{"Content-Type": "application/json"}' + check-index: + runs-on: ubuntu-latest + name: Checks that the latest index is still working + steps: + - uses: fjogeleit/http-request-action@v1 + id: search + with: + url: "https://NTSX40VZB8-dsn.algolia.net/1/indexes/kurtosis/query" + method: 'POST' + customHeaders: '{"X-Algolia-API-Key": "4269c726c2fea4e6cddfeb9a21cd3d4e", "X-Algolia-Application-Id": "NTSX40VZB8"}' + data: '{ "params": "query=add_service&hitsPerPage=2&getRankingInfo=1" }' + - name: Show Response + run: | + #!/bin/bash + set -eou pipefail + + if (( ${{ fromJson(steps.search.outputs.response).nbHits }} > 100 )); then + echo "Results are greater than 100" + else + echo "Results are not greater than 100" + exit 1 + fi + needs: reindex-website-main + diff --git a/.github/workflows/reindex-website-release.yml b/.github/workflows/reindex-website-release.yml deleted file mode 100644 index 1804c2c17a..0000000000 --- a/.github/workflows/reindex-website-release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Reindex website with Algolia Docsearch for Releases" -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' -jobs: - reindex-website-release: - runs-on: ubuntu-latest - name: Update website search index via Algolia Crawler - steps: - - uses: fjogeleit/http-request-action@v1 - with: - url: 'https://crawler.algolia.com/api/1/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/reindex' - method: 'POST' - username: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} - password: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} - customHeaders: '{"Content-Type": "application/json"}'