haystack/.github/workflows/docusaurus_sync.yml
dependabot[bot] 12c9c76a40
chore(deps): bump actions/checkout from 5 to 6 (#10128)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 16:14:45 +01:00

61 lines
1.8 KiB
YAML

name: Sync docs with Docusaurus
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docs/pydoc/config_docusaurus/**"
- "haystack/**"
- ".github/workflows/docusaurus_sync.yml"
env:
HATCH_VERSION: "1.14.2"
PYTHON_VERSION: "3.11"
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Haystack repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}
- name: Generate API reference for Docusaurus
# This command simply runs ./.github/utils/pydoc-markdown.sh with a specific config path
run: hatch run readme:sync "../config_docusaurus/*"
- name: Sync generated API reference to docs folder
run: |
SOURCE_PATH="docs/pydoc/temp"
DEST_PATH="docs-website/reference/haystack-api"
echo "Syncing from $SOURCE_PATH to $DEST_PATH"
mkdir -p $DEST_PATH
# Using rsync to copy files. This will also remove files in dest that are no longer in source.
rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$DEST_PATH/"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
commit-message: "Sync Haystack API reference on Docusaurus"
branch: sync-docusaurus-api-reference
base: main
title: "docs: sync Haystack API reference on Docusaurus"
add-paths: |
docs-website/reference/haystack-api
body: |
This PR syncs the Haystack API reference on Docusaurus. Just approve and merge it.