c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Update Platform Components Table / update (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker image release / Build base image (push) Waiting to run
67 lines
2.0 KiB
YAML
67 lines
2.0 KiB
YAML
name: Sync docs with Docusaurus
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "pydoc/**"
|
|
- "haystack/**"
|
|
- ".github/workflows/docusaurus_sync.yml"
|
|
|
|
env:
|
|
HATCH_VERSION: "1.16.5"
|
|
PYTHON_VERSION: "3.11"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-slim
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout Haystack repo
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
with:
|
|
python-version: "${{ env.PYTHON_VERSION }}"
|
|
|
|
- name: Install Hatch
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install hatch==${{ env.HATCH_VERSION }} --uploaded-prior-to=P1D
|
|
|
|
- name: Generate API reference for Docusaurus
|
|
run: hatch run docs
|
|
|
|
- name: Sync generated API reference to docs folder
|
|
run: |
|
|
SOURCE_PATH="tmp_api_reference"
|
|
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@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
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.
|