Skip to content

feat: Async experiments #194

feat: Async experiments

feat: Async experiments #194

Workflow file for this run

name: Sync docs with Readme
on:
pull_request:
paths:
- "docs/pydoc/**"
push:
branches:
- main
env:
HATCH_VERSION: "1.13.0"
PYTHON_VERSION: "3.10"
SYNC_LAST_N_HAYSTACK_VERSIONS: 1
jobs:
get-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.version_finder.outputs.versions }}
steps:
- name: Get Haystack Docs versions
id: version_finder
run: |
curl -s "https://dash.readme.com/api/v1/version" --header "authorization: Basic ${{ secrets.README_API_KEY }}" > out
VERSIONS=$(jq -c '[ .[] | select(.version | startswith("2.")) | .version ] | .[-${{ env.SYNC_LAST_N_HAYSTACK_VERSIONS }}:]' out)
{
echo 'versions<<EOF'
echo "$VERSIONS"
echo EOF
} >> "$GITHUB_OUTPUT"
sync:
runs-on: ubuntu-latest
needs: get-versions
strategy:
fail-fast: false
max-parallel: 1
matrix:
hs-docs-version: ${{ fromJSON(needs.get-versions.outputs.versions) }}
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}
- name: Generate API docs
env:
# This is necessary to fetch the documentation categories
# from Readme.io as we need them to associate the slug
# in config files with their id.
README_API_KEY: ${{ secrets.README_API_KEY }}
# The command is a bit misleading, we're not actually syncing anything here,
# we're just generating the markdown files from the the yaml configs.
PYDOC_TOOLS_HAYSTACK_DOC_VERSION: ${{ matrix.hs-docs-version }}
run: hatch run readme:sync
- name: Sync docs for ${{ matrix.hs-docs-version }}
if: github.event_name == 'push'
uses: readmeio/rdme@v8
with:
rdme: docs ./docs/pydoc/temp --key=${{ secrets.README_API_KEY }} --version=${{ matrix.hs-docs-version }}