fix: Make experimental Agent compatible with Haystack main and Haysta… #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync API reference with Docusaurus | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+*" | |
| # Manual trigger: Use this ONLY if the automatic API reference sync failed during a release. | |
| # This will regenerate and sync the API reference to the Haystack repository. | |
| # WARNING: Running this workflow when this repository has evolved significantly since the release | |
| # will sync an incorrect API reference to Haystack. | |
| workflow_dispatch: | |
| jobs: | |
| generate-api-reference: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -U haystack-pydoc-tools | |
| - name: Generate API reference | |
| run: ./.github/utils/pydoc-markdown.sh "../config_docusaurus/*" | |
| - name: Upload API reference artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: experimental-api-reference | |
| path: docs/pydoc/temp | |
| if-no-files-found: error | |
| retention-days: 1 | |
| overwrite: true | |
| sync-api-reference: | |
| runs-on: ubuntu-latest | |
| needs: generate-api-reference | |
| steps: | |
| - name: Checkout Haystack repo | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: deepset-ai/haystack | |
| ref: main | |
| token: ${{ secrets.HAYSTACK_BOT_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Download API reference artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: experimental-api-reference | |
| path: temp_api_reference | |
| - name: Sync API reference | |
| run: | | |
| # Function to sync generated API reference to a destination | |
| sync_to_dest() { | |
| echo "Syncing to $1" | |
| mkdir -p "$1" | |
| rsync -av --delete --exclude='.git/' "temp_api_reference/" "$1/" | |
| } | |
| # Sync to main reference | |
| sync_to_dest "docs-website/reference/experiments-api" | |
| # Sync to all versioned directories | |
| if [ -d "docs-website/reference_versioned_docs" ]; then | |
| for version_dir in "docs-website/reference_versioned_docs"/version-*; do | |
| [ -d "$version_dir" ] && sync_to_dest "$version_dir/experiments-api" | |
| done | |
| fi | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.HAYSTACK_BOT_TOKEN }} | |
| commit-message: "Sync Haystack Experimental API reference on Docusaurus" | |
| branch: sync-docusaurus-api-reference-experimental | |
| base: main | |
| title: "docs: sync Haystack Experimental API reference on Docusaurus" | |
| add-paths: | | |
| docs-website | |
| body: | | |
| This PR syncs the Haystack Experimental API reference on Docusaurus. Just approve and merge it. |