Skip to content

Merge pull request #939 from vespa-engine/thomasht86/support-requestt… #564

Merge pull request #939 from vespa-engine/thomasht86/support-requestt…

Merge pull request #939 from vespa-engine/thomasht86/support-requestt… #564

Workflow file for this run

name: pyvespa documentation search feed
on:
push:
branches: [master]
env:
DATA_PLANE_PUBLIC_KEY: ${{ secrets.VESPA_TEAM_DATA_PLANE_PUBLIC_CERT }}
DATA_PLANE_PRIVATE_KEY: ${{ secrets.VESPA_TEAM_DATA_PLANE_PRIVATE_KEY }}
VESPA_CLI_DATA_PLANE_CERT: ${{ secrets.VESPA_TEAM_VESPA_CLI_DATA_PLANE_CERT }}
VESPA_CLI_DATA_PLANE_KEY: ${{ secrets.VESPA_TEAM_VESPA_CLI_DATA_PLANE_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Sphinx
run: |
sudo apt-get install -y pandoc
python3 -m pip install --upgrade pip
python3 -m pip install -e .[docs,feed]
- name: Build site
run: |
sphinx-build -E -D nbsphinx_allow_errors=True -b html docs/sphinx/source docs/sphinx/build
# Add front matter and strip liquid macros from html files
find docs/sphinx/build -name \*.html | \
while read f; do \
{ echo "---"; echo "---"; sed 's/{%/{ %/g; s/%}/% }/g; s/{{/{ {/g; s/}}/} }/g' < ${f}; } >${f}.new; \
mv ${f}.new ${f}; \
done
bundle exec jekyll build -s docs/sphinx/build/ -p _plugins-vespafeed --config _config.yml
- name: Feed site
run: |
# The python scripts below uses the Vespa CLI for feeding / data access.
# See https://docs.vespa.ai/en/vespa-cli.html.
# The environment variables below have credentials for endpoint access -
# use the key/cert files in .vespa and paste their content into GitHub Secrets.
# VESPA_CLI_API_KEY must be set and empty as below.
export VESPA_CLI_DATA_PLANE_CERT
export VESPA_CLI_DATA_PLANE_KEY
export VESPA_CLI_API_KEY=
./feed_to_vespa.py _config.yml
- name: Feed paragraphs site
run: |
export VESPA_CLI_DATA_PLANE_CERT
export VESPA_CLI_DATA_PLANE_KEY
export VESPA_CLI_API_KEY=
./feed-split.py pyvespa_index.json https://pyvespa.readthedocs.io/en/latest questions.jsonl
./feed_to_vespa.py _paragraphs_config.yml
- name: Feed suggestions
run: |
export VESPA_CLI_DATA_PLANE_CERT
export VESPA_CLI_DATA_PLANE_KEY
export VESPA_CLI_API_KEY=
./feed_to_vespa.py _suggestions_config.yml