workflow_dispatch version input for sync search (#32207)
This commit is contained in:
14
.github/workflows/sync-search-elasticsearch.yml
vendored
14
.github/workflows/sync-search-elasticsearch.yml
vendored
@@ -7,6 +7,11 @@ name: Sync search Elasticsearch
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version to exclusively generate the search index for. E.g. 'dotcom', 'ghes-3.7', 'ghae'"
|
||||
required: false
|
||||
default: ''
|
||||
schedule:
|
||||
- cron: '23 */4 * * *' # Run every 4 hours at 23 minutes past the hour
|
||||
|
||||
@@ -88,6 +93,10 @@ jobs:
|
||||
# let's just accept an empty string instead.
|
||||
THROW_ON_EMPTY: false
|
||||
|
||||
# Note that by default, this is '' (empty string) and that means
|
||||
# the same as not set within the script.
|
||||
VERSION: ${{ github.event.inputs.version }}
|
||||
|
||||
run: |
|
||||
mkdir /tmp/records
|
||||
npm run sync-search-indices -- \
|
||||
@@ -102,6 +111,11 @@ jobs:
|
||||
curl --fail --retry-connrefused --retry 5 -I ${{ env.ELASTICSEARCH_URL }}
|
||||
|
||||
- name: Index into Elasticsearch
|
||||
env:
|
||||
# Must match what we used when scraping (npm run sync-search-indices)
|
||||
# otherwise the script will seek other versions from disk that might
|
||||
# not exist.
|
||||
VERSION: ${{ github.event.inputs.version }}
|
||||
run: |
|
||||
./script/search/index-elasticsearch.js \
|
||||
--language ${{ matrix.language }} -- /tmp/records
|
||||
|
||||
Reference in New Issue
Block a user