From c48a6f793fa56eb72b3b1f8468d8b57a7024298b Mon Sep 17 00:00:00 2001 From: Webber Date: Thu, 19 May 2022 23:20:28 +0200 Subject: [PATCH 1/4] feat: crawl PR and production --- .github/workflows/search-main.yml | 22 +++++++++++++++++++ .github/workflows/search-pr.yml | 32 ++++++++++++++++++++++++++++ .github/workflows/search-trigger.yml | 14 ------------ 3 files changed, 54 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/search-main.yml create mode 100644 .github/workflows/search-pr.yml delete mode 100644 .github/workflows/search-trigger.yml diff --git a/.github/workflows/search-main.yml b/.github/workflows/search-main.yml new file mode 100644 index 00000000..5e95bd27 --- /dev/null +++ b/.github/workflows/search-main.yml @@ -0,0 +1,22 @@ +name: Vercel -> Algolia Crawler (main) +on: + push: + branches: [ main ] + +jobs: + algolia_recrawl: + name: Algolia Recrawl + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Vercel-MAIN => Algolia crawler creation and recrawl on preview (Main branch) + uses: algolia/algoliasearch-crawler-github-actions@v1 + id: crawler_push + with: + crawler-user-id: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} + crawler-api-key: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} + algolia-app-id: E57FOT37U9 + algolia-api-key: ${{ secrets.ALGOLIA_APP_API_KEY }} + site-url: 'https://algoliasearch-crawler-github-actions.vercel.app/' + override-config: true diff --git a/.github/workflows/search-pr.yml b/.github/workflows/search-pr.yml new file mode 100644 index 00000000..7e41815a --- /dev/null +++ b/.github/workflows/search-pr.yml @@ -0,0 +1,32 @@ +name: Vercel -> Algolia Crawler (PR) +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + algolia_recrawl: + name: Algolia Recrawl + runs-on: ubuntu-latest + steps: + # checkout this repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # Get url directly from vercel + - name: Get deployment URL + id: deployment + uses: dorshinar/get-deployment-url@master + timeout-minutes: 1 + with: + token: ${{ github.token }} + + - name: Vercel-PR => Algolia crawler creation and recrawl on preview (Pull Request) + uses: algolia/algoliasearch-crawler-github-actions@v1 + id: crawler_pr + with: + crawler-user-id: '${{ secrets.ALGOLIA_CRAWLER_USER_ID }}' + crawler-api-key: '${{ secrets.ALGOLIA_CRAWLER_API_KEY }}' + algolia-app-id: 'E57FOT37U9' + algolia-api-key: '${{ secrets.ALGOLIA_APP_API_KEY }}' + site-url: '${{ steps.deployment.outputs.deployment }}' + override-config: true diff --git a/.github/workflows/search-trigger.yml b/.github/workflows/search-trigger.yml deleted file mode 100644 index 63f6cb5b..00000000 --- a/.github/workflows/search-trigger.yml +++ /dev/null @@ -1,14 +0,0 @@ -on: - workflow_dispatch: {} - -jobs: - updateSearchIndex: - name: Update search index - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: darrenjennings/algolia-docsearch-action@da2ed379c147b356d60dbfec68bdcfacb2791a98 - with: - algolia_application_id: 'E57FOT37U9' - algolia_api_key: '${{ secrets.ALGOLIA_DOC_SEARCH_CRAWLER_KEY }}' - file: algolia.config.js From 4dc6cd68e28c268c6738702dcf31e57af9c6268b Mon Sep 17 00:00:00 2001 From: Webber Date: Thu, 19 May 2022 23:22:11 +0200 Subject: [PATCH 2/4] quote values --- .github/workflows/search-main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/search-main.yml b/.github/workflows/search-main.yml index 5e95bd27..590a4bcc 100644 --- a/.github/workflows/search-main.yml +++ b/.github/workflows/search-main.yml @@ -1,22 +1,22 @@ name: Vercel -> Algolia Crawler (main) on: push: - branches: [ main ] + branches: [main] jobs: algolia_recrawl: - name: Algolia Recrawl + name: Algolia recrawl runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - - name: Vercel-MAIN => Algolia crawler creation and recrawl on preview (Main branch) + - name: Vercel-Main => Algolia crawler creation and recrawl on preview (Main branch) uses: algolia/algoliasearch-crawler-github-actions@v1 id: crawler_push with: - crawler-user-id: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} - crawler-api-key: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} - algolia-app-id: E57FOT37U9 - algolia-api-key: ${{ secrets.ALGOLIA_APP_API_KEY }} + crawler-user-id: '${{ secrets.ALGOLIA_CRAWLER_USER_ID }}' + crawler-api-key: '${{ secrets.ALGOLIA_CRAWLER_API_KEY }}' + algolia-app-id: 'E57FOT37U9' + algolia-api-key: '${{ secrets.ALGOLIA_APP_API_KEY }}' site-url: 'https://algoliasearch-crawler-github-actions.vercel.app/' override-config: true From 999409f9c7671df2ee539ebceaf83eef385f62be Mon Sep 17 00:00:00 2001 From: Webber Date: Thu, 19 May 2022 23:23:46 +0200 Subject: [PATCH 3/4] fix typos --- .github/workflows/search-pr.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/search-pr.yml b/.github/workflows/search-pr.yml index 7e41815a..a53be65e 100644 --- a/.github/workflows/search-pr.yml +++ b/.github/workflows/search-pr.yml @@ -5,21 +5,17 @@ on: jobs: algolia_recrawl: - name: Algolia Recrawl + name: Algolia recrawl runs-on: ubuntu-latest steps: - # checkout this repo - name: Checkout Repo uses: actions/checkout@v2 - - # Get url directly from vercel - - name: Get deployment URL + - name: Get deployment URL from Vercel id: deployment uses: dorshinar/get-deployment-url@master timeout-minutes: 1 with: token: ${{ github.token }} - - name: Vercel-PR => Algolia crawler creation and recrawl on preview (Pull Request) uses: algolia/algoliasearch-crawler-github-actions@v1 id: crawler_pr From 2292059ad9fc746cbec8cf6526a529f04578d33e Mon Sep 17 00:00:00 2001 From: Webber Date: Thu, 19 May 2022 23:43:07 +0200 Subject: [PATCH 4/4] show the real error --- .github/workflows/search-main.yml | 6 +++--- .github/workflows/search-pr.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/search-main.yml b/.github/workflows/search-main.yml index 590a4bcc..03bbeb86 100644 --- a/.github/workflows/search-main.yml +++ b/.github/workflows/search-main.yml @@ -14,9 +14,9 @@ jobs: uses: algolia/algoliasearch-crawler-github-actions@v1 id: crawler_push with: - crawler-user-id: '${{ secrets.ALGOLIA_CRAWLER_USER_ID }}' - crawler-api-key: '${{ secrets.ALGOLIA_CRAWLER_API_KEY }}' + crawler-user-id: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} + crawler-api-key: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} algolia-app-id: 'E57FOT37U9' - algolia-api-key: '${{ secrets.ALGOLIA_APP_API_KEY }}' + algolia-api-key: ${{ secrets.ALGOLIA_APP_API_KEY }} site-url: 'https://algoliasearch-crawler-github-actions.vercel.app/' override-config: true diff --git a/.github/workflows/search-pr.yml b/.github/workflows/search-pr.yml index a53be65e..636255df 100644 --- a/.github/workflows/search-pr.yml +++ b/.github/workflows/search-pr.yml @@ -17,12 +17,12 @@ jobs: with: token: ${{ github.token }} - name: Vercel-PR => Algolia crawler creation and recrawl on preview (Pull Request) - uses: algolia/algoliasearch-crawler-github-actions@v1 + uses: webbertakken/algoliasearch-crawler-github-actions@4f4c4db12be599fbc3f407ff6d608461c09a8f6a id: crawler_pr with: - crawler-user-id: '${{ secrets.ALGOLIA_CRAWLER_USER_ID }}' - crawler-api-key: '${{ secrets.ALGOLIA_CRAWLER_API_KEY }}' + crawler-user-id: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }} + crawler-api-key: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }} algolia-app-id: 'E57FOT37U9' - algolia-api-key: '${{ secrets.ALGOLIA_APP_API_KEY }}' + algolia-api-key: ${{ secrets.ALGOLIA_APP_API_KEY }} site-url: '${{ steps.deployment.outputs.deployment }}' override-config: true