Repo sync #1295
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: Index autocomplete search in Elasticsearch | |
| # Keep Elasticsearch autocomplete data current for AI search APIs. | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '20 16 * * 1-5' | |
| pull_request: | |
| paths: | |
| - .github/workflows/index-autocomplete-search.yml | |
| - 'src/search/scripts/index/**' | |
| - 'package*.json' | |
| permissions: | |
| contents: read | |
| jobs: | |
| index-autocomplete-elasticsearch: | |
| if: ${{ github.repository == 'github/docs-internal' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: ./.github/actions/node-npm-setup | |
| - uses: ./.github/actions/setup-elasticsearch | |
| if: ${{ github.event_name == 'pull_request' }} | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| token: ${{ secrets.DOCS_BOT_PAT_BASE }} | |
| repository: github/docs-internal-data | |
| path: docs-internal-data | |
| - name: Check that Elasticsearch is accessible | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: curl --fail --retry-connrefused --retry 5 -I http://localhost:9200 | |
| - name: Run AI search auto-complete indexing | |
| env: | |
| ELASTICSEARCH_URL: ${{ github.event_name == 'pull_request' && 'http://localhost:9200' || secrets.ELASTICSEARCH_URL }} | |
| run: npm run index-ai-search-autocomplete -- docs-internal-data | |
| - uses: ./.github/actions/create-workflow-failure-issue | |
| id: create-failure-issue | |
| if: ${{ failure() && github.event_name == 'schedule' }} | |
| with: | |
| token: ${{ secrets.DOCS_BOT_PAT_BASE }} | |
| - uses: ./.github/actions/slack-alert | |
| if: ${{ failure() && github.event_name == 'schedule' }} | |
| with: | |
| slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} | |
| issue_url: ${{ steps.create-failure-issue.outputs.issue_url }} |