Skip to content

Commit 94e3c09

Browse files
authored
English search sync (github#21446)
1 parent a1e261c commit 94e3c09

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

.github/actions-scripts/enterprise-server-issue-templates/release-issue.md

+3
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,8 @@ This file should be automatically updated, but you can also run `script/update-e
106106
- [ ] Remove `[DO NOT MERGE]` and other meta information from the PR title 😜.
107107
- [ ] The `github/docs-internal` repo is frozen, and the `Repo Freeze Check / Prevent merging during deployment freezes (pull_request_target)` test is expected to fail. Use admin permissions to ship the release branch with this failure.
108108
- [ ] Do any required smoke tests.
109+
- [ ] Push the search index LFS objects for the public `github/docs` repo. The LFS objects were already being pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects, run the [search sync workflow](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml) with the following inputs:
110+
version: `enterprise-server@<RELEASE>`
111+
language: `en`
109112
- [ ] Once smoke tests have passed, you can [unfreeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) and post an announcement in Slack.
110113
- [ ] After the release, in the `docs-content` repo, add the now live version number to the "Specific GHES version(s)" section in the following files: [`.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml) and [`.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml). When the PR is approved, merge it in.

.github/workflows/sync-search-indices.yml

+11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ name: Sync search indexes
2121

2222
on:
2323
workflow_dispatch:
24+
inputs:
25+
language:
26+
description: 'Language to generate the search index for. Can be one of: `en` English, `cn` Chinese simplified, `ja` Japanese, `es` Spanish, `pt` Portuguese., `all` all languages.'
27+
required: false
28+
default: 'all'
29+
version:
30+
description: 'Version to generate the search index for. Can be one of: `free-pro-team@latest`, `enterprise-server@<RELEASE NUMBER>`, `github-ae@latest`, `all` all versions.'
31+
required: false
32+
default: 'all'
2433
schedule:
2534
- cron: '53 0/8 * * *' # Run every eight hours at 53 minutes past the hour
2635

@@ -58,6 +67,8 @@ jobs:
5867
- name: Update search indexes
5968
env:
6069
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
VERSION: ${{ github.event.inputs.version }}
71+
LANGUAGE: ${{ github.event.inputs.language }}
6172
run: npm run sync-search
6273

6374
- name: Update private docs repository search indexes

contributing/search.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The Actions workflow progress can be viewed (by GitHub employees) in the [Action
4343

4444
## Manually triggering the search index update workflow
4545

46-
You can manually run the workflow to generate the indexes after you push your changes to `main` to speed up the indexing when needed. To run it manually, click "Run workflow" button in the [Actions tab](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml).
46+
You can manually run the workflow to generate the indexes after you push your changes to `main` to speed up the indexing when needed. It's recommended to do this for only the `free-pro-team@latest` version and the `en` language because running all languages and versions take about 40 minutes. To run it manually, click "Run workflow" button in the [Actions tab](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml). Enter the language and version you'd like to generate the indexes for as inputs to the workflow. By default, all language and versions are generated.
4747

4848
## Generating search indexes for your local checkout
4949

script/sync-search-indices.js

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ main()
1414

1515
async function main() {
1616
const sync = searchSync
17+
// When called by the .github/workflows/sync-search-indices workflow
18+
// the variable can be set to all or an empty string.
19+
//
20+
// The script/search/sync script expects the variables to be unset
21+
// to select all languages or versions.
22+
if (process.env.LANGUAGE === 'all' || process.env.LANGUAGE === '') {
23+
delete process.env.LANGUAGE
24+
}
25+
if (process.env.VERSION === 'all' || process.env.VERSION === '') {
26+
delete process.env.VERSION
27+
}
28+
1729
const opts = {
1830
dryRun: 'DRY_RUN' in process.env,
1931
language: process.env.LANGUAGE,

0 commit comments

Comments
 (0)