Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](937d244753...48af2dc4a9)
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Sese <rsese@github.com>
95 lines
3.6 KiB
YAML
95 lines
3.6 KiB
YAML
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@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
|
|
with:
|
|
node-version: 16.14.x
|
|
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
|