2.0.0 #69
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 | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| 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 Vite+ | |
| uses: voidzero-dev/setup-vp@v1 | |
| with: | |
| node-version: 24 | |
| cache: true | |
| - name: Install dependencies | |
| run: vp install | |
| - 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.RV_PAT1 }} | |
| GITHUB_PAT2: ${{ secrets.RV_PAT2 }} | |
| run: vp run generate:index | |
| - name: Commit search index | |
| if: ${{ hashFiles('public/search-index/**') != '' }} | |
| run: | | |
| set -euo pipefail | |
| INDEX_DIR="public/search-index" | |
| if [ ! -d "$INDEX_DIR" ]; then | |
| echo "Index directory not found, skip publishing: $INDEX_DIR" | |
| exit 0 | |
| 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 |