haystack/.github/workflows/readme_sync.yml
Tobias Wochinger ba49905eff
ci: unify dependency management + hatch scripts (#7079)
* ci: unify dependency management + hatch scripts

* ci: migrate readme sync

* build: migrate snippets

* ci: pin hatch

* ci: make Python version more explicit + quote

* ci: add scripts with parameters to hatch

---------

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
2024-02-26 15:40:10 +01:00

45 lines
1.1 KiB
YAML

name: Sync docs with Readme
on:
pull_request:
paths:
- "docs/pydoc/**"
push:
branches:
- main
env:
HATCH_VERSION: "1.9.3"
PYTHON_VERSION: "3.10"
jobs:
sync:
runs-on: ubuntu-latest
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 }}
run: hatch run readme:sync
- name: Sync docs with 2.0
# Sync the docs to the `2.0` version on Readme
id: sync-main
if: github.ref_name == 'main' && github.event_name == 'push'
uses: readmeio/rdme@v8
with:
rdme: docs ./docs/pydoc/temp --key=${{ secrets.README_API_KEY }} --version=v2.0