From 33cc5cf0085756e02fea0c2512ec8629ef129d37 Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Fri, 9 Feb 2024 14:02:35 +0200 Subject: [PATCH] .github/workflows/updatesearch: Search service index updating --- .github/workflows/updatesearch.yaml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/updatesearch.yaml diff --git a/.github/workflows/updatesearch.yaml b/.github/workflows/updatesearch.yaml new file mode 100644 index 000000000..88bb09834 --- /dev/null +++ b/.github/workflows/updatesearch.yaml @@ -0,0 +1,35 @@ +name: Update the search database +on: + push: + branches: + - master + +jobs: + update-search-index: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.12"] + steps: + - uses: actions/checkout@v4 + # https://github.com/actions/setup-python + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install deps + run: | + pip install sphinx sphinx_rtd_theme markdownify beautifulsoup4 + pip install -r requirements.txt + - name: Build project + run: | + make dirhtml SPHINXOPTS="-w warnings.txt" + - name: Cat warnings + run: | + cat warnings.txt + - name: Upload new data + env: + SEARCH_UPDATE_AUTHORIZATION: ${{ secrets.SEARCH_UPDATE_AUTHORIZATION }} + SEARCH_URL: ${{ secrets.SEARCH_URL }} + run: | + python _meta/search.py --db=search.db update "$SEARCH_URL"