diff --git a/.github/workflows/search-main.yml b/.github/workflows/search-main.yml new file mode 100644 index 00000000..03bbeb86 --- /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..636255df --- /dev/null +++ b/.github/workflows/search-pr.yml @@ -0,0 +1,28 @@ +name: Vercel -> Algolia Crawler (PR) +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + algolia_recrawl: + name: Algolia recrawl + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - 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: 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 }} + 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