1.3.9.06 #54
Workflow file for this run
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: Repo Viewer Search Index | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| paths-ignore: | |
| - "public/search-index/**" | |
| workflow_dispatch: {} | |
| jobs: | |
| generate-index: | |
| runs-on: ubuntu-latest | |
| environment: RV-Index | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: "npm" | |
| cache-dependency-path: "package-lock.json" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate docfind index | |
| env: | |
| ENABLED_SEARCH_INDEX: "true" | |
| SEARCH_INDEX_GENERATION_MODE: "action" | |
| SEARCH_INDEX_BRANCHES: ${{ vars.SEARCH_INDEX_BRANCHES }} | |
| GITHUB_REPO_OWNER: ${{ vars.GITHUB_REPO_OWNER || github.repository_owner }} | |
| GITHUB_REPO_NAME: ${{ vars.GITHUB_REPO_NAME || github.event.repository.name }} | |
| GITHUB_REPO_BRANCH: ${{ vars.GITHUB_REPO_BRANCH || github.ref_name }} | |
| GITHUB_PAT1: ${{ secrets.GITHUB_PAT1 }} | |
| GITHUB_PAT2: ${{ secrets.GITHUB_PAT2 }} | |
| run: npm run generate:index | |
| - name: Commit search index | |
| run: | | |
| set -euo pipefail | |
| INDEX_DIR="public/search-index" | |
| if [ ! -d "$INDEX_DIR" ]; then | |
| echo "Index directory not found: $INDEX_DIR" | |
| exit 1 | |
| fi | |
| WORKTREE_DIR="${RUNNER_TEMP}/rv-index" | |
| git worktree add --detach "$WORKTREE_DIR" | |
| cd "$WORKTREE_DIR" | |
| git checkout --orphan "RV-Index" | |
| git rm -r --quiet --force . || true | |
| mkdir -p "public/search-index" | |
| cp -R "${GITHUB_WORKSPACE}/${INDEX_DIR}/." "public/search-index/" | |
| git add -A | |
| if git diff --cached --quiet; then | |
| echo "No index changes." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -m "chore(search-index): update docfind index" | |
| git push --force origin HEAD:RV-Index |