Index Documentation #41379
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: Index Documentation | |
| on: | |
| schedule: | |
| # Run every hour to keep search index up to date | |
| - cron: '0 * * * *' | |
| workflow_dispatch: | |
| # Allow manual triggering for testing | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'src/**' | |
| - 'docusaurus.config.ts' | |
| - 'sidebars.ts' | |
| - 'package.json' | |
| jobs: | |
| index-docs: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'replicatedhq/troubleshoot' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: make install | |
| - name: Build documentation | |
| run: make build | |
| - name: Index documentation with Algolia | |
| env: | |
| APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
| API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
| run: | | |
| # Install jq for JSON processing | |
| sudo apt-get update && sudo apt-get install -y jq | |
| # Run Algolia DocSearch Scraper | |
| docker run \ | |
| -e APPLICATION_ID=$APPLICATION_ID \ | |
| -e API_KEY=$API_KEY \ | |
| -e "CONFIG=$(cat ./troubleshoot-algolia-config-docusaurus.json | jq -r tostring)" \ | |
| algolia/docsearch-scraper | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "::error::Documentation indexing failed. Please check the logs and ensure Algolia credentials are properly configured." |