Skip to content

Populate Search Engine #32

Populate Search Engine

Populate Search Engine #32

name: Populate Search Engine
on:
# schedule:
# - cron: "5 7 * * *" # every day at 07:05
# to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
process-docs:
runs-on: ubuntu-latest
timeout-minutes: 360 # Set timeout to 6 hours
steps:
- name: Checkout doc-builder
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python 3.10
run: uv python install 3.10
- name: Install doc-builder
run: uv sync --extra dev
- name: Populate search engine from HF doc-build dataset
env:
HF_IE_URL: ${{ secrets.HF_IE_URL }}
HF_IE_TOKEN: ${{ secrets.HF_IE_TOKEN }}
MEILISEARCH_KEY: ${{ secrets.MEILISEARCH_KEY }}
run: uv run doc-builder populate-search-engine
gradio-job:
runs-on: ubuntu-latest
steps:
- name: Checkout doc-builder
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python 3.10
run: uv python install 3.10
- name: Install doc-builder
run: uv sync --extra dev
- name: Add gradio docs to meilisearch
env:
HF_IE_URL: ${{ secrets.HF_IE_URL }}
HF_IE_TOKEN: ${{ secrets.HF_IE_TOKEN }}
MEILISEARCH_KEY: ${{ secrets.MEILISEARCH_KEY }}
run: uv run doc-builder add-gradio-docs
# cleanup-job:
# needs: [process-docs, gradio-job]
# runs-on: ubuntu-latest
# if: always() # This ensures that the cleanup job runs regardless of the result
# steps:
# - name: Checkout doc-builder
# uses: actions/checkout@v4
# - name: Install uv
# uses: astral-sh/setup-uv@v4
# with:
# version: "latest"
# - name: Set up Python 3.10
# run: uv python install 3.10
# - name: Install doc-builder
# run: uv sync --extra dev
# - name: Success Cleanup
# if: needs.process-docs.result == 'success' # Runs if job succeeded
# env:
# MEILISEARCH_KEY: ${{ secrets.MEILISEARCH_KEY }}
# run: uv run doc-builder meilisearch-clean --swap
# - name: Failure Cleanup
# if: needs.process-docs.result == 'failure' # Runs if job failed
# env:
# MEILISEARCH_KEY: ${{ secrets.MEILISEARCH_KEY }}
# run: uv run doc-builder meilisearch-clean