Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
docs/.github/workflows/enterprise-release-sync-search-index.yml at main · vb2ae/docs · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
vb2ae
docs
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
docs
/
.github
/
workflows
/
enterprise-release-sync-search-index.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
94 lines (83 loc) · 3.59 KB
main
Breadcrumbs
docs
/
.github
/
workflows
/
enterprise-release-sync-search-index.yml
Copy path
Top
File metadata and controls
Code
Blame
94 lines (83 loc) · 3.59 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name
:
Enterprise Server Release Search Sync
#
**What it does**: This workflow is used during the Enterprise Server release
#
process. The Enterprise release checklist includes a step to add a label in
#
the format `sync-english-index-for-enterprise-server@<RELEASE NUMBER>`. When
#
that label is added, this workflow runs anytime new commits are made to the
#
Enterprise release megabranch. The Docubot user commits the search indexes in
#
the `lib/search/indexes` directory.
#
#
**Why we have it**: The Lunr index for the next Enterprise release doesn't yet
#
exist, so we need to generate it. Search wouldn't work at all if we shipped
#
the new release without shipping the index for that release at the same time.
#
#
**Who does it impact**: The DRI for the Enterprise release, the content
#
writers that are a part of the release and the docs-engineering DRI.
on
:
workflow_dispatch
:
pull_request
:
types
:
-
labeled
-
unlabeled
-
opened
-
reopened
-
synchronize
-
ready_for_review
-
unlocked
permissions
:
contents
:
write
#
This allows a subsequently queued workflow run to interrupt previous runs
concurrency
:
group
:
'
${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
'
cancel-in-progress
:
true
#
This workflow requires a label in the format `sync-english-index-for-<PLAN@RELEASE>`
jobs
:
updateIndices
:
name
:
Update English index for new GHES release
#
Skip this check if the event originated from Docubot, to prevent
#
infinite runs when Docubot checks in the search indexes in this workflow
if
:
github.repository == 'github/docs-internal' && github.event.sender.login != 'Docubot' && github.actor != 'dependabot[bot]'
runs-on
:
ubuntu-latest
steps
:
-
name
:
checkout
uses
:
actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with
:
ref
:
${{ github.head_ref }}
token
:
${{ secrets.DOCUBOT_REPO_PAT }}
-
name
:
Setup Node
uses
:
actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
with
:
node-version
:
'
16.15.0
'
cache
:
npm
-
name
:
Install dependencies
run
:
npm ci
-
name
:
Get GHES release number from search label if present; only continue if the label is found.
id
:
getVersion
run
:
$GITHUB_WORKSPACE/.github/actions-scripts/enterprise-search-label.js
-
name
:
Cache nextjs build
uses
:
actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with
:
path
:
.next/cache
key
:
${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}
-
name
:
Generate the search index files
if
:
${{ steps.getVersion.outputs.versionToSync }}
env
:
VERSION
:
${{ steps.getVersion.outputs.versionToSync }}
LANGUAGE
:
'
en
'
run
:
|
npm run build
npm run sync-search
-
name
:
Commit the index files and push LFS objects
if
:
${{ steps.getVersion.outputs.versionToSync }}
run
:
|
echo 'git config user.name Docubot'
git config user.name Docubot
echo 'git config user.email 67483024+docubot@users.noreply.github.com'
git config user.email 67483024+docubot@users.noreply.github.com
echo 'git add lib/search/indexes'
git add lib/search/indexes/*
echo 'git commit -m "update search indexes"'
git commit -m 'update search indexes'
echo 'git lfs push --all origin'
git lfs push --all origin
echo 'git push origin' $GITHUB_HEAD_REF '--set-upstream'
git push origin $GITHUB_HEAD_REF --set-upstream
You can’t perform that action at this time.