@@ -42,14 +42,84 @@ jobs:
4242 - name : Generate API reference
4343 run : ./.github/utils/pydoc-markdown.sh "../config_docusaurus/*"
4444
45- - name : print files
46- run : ls -la docs/pydoc/temp
45+ - name : Upload API reference artifact
46+ uses : actions/upload-artifact@v4
47+ with :
48+ name : experimental-api-reference
49+ path : docs/pydoc/temp
50+ if-no-files-found : error
51+ retention-days : 1
52+ overwrite : true
53+
54+
55+ sync-api-reference :
56+ runs-on : ubuntu-latest
57+ needs : generate-api-reference
58+
59+ steps :
60+ - name : Checkout Haystack repo
61+ uses : actions/checkout@v5
62+ with :
63+ repository : deepset-ai/haystack
64+ ref : main
65+ token : ${{ secrets.HAYSTACK_BOT_TOKEN }}
66+
67+ - name : Set up Python
68+ uses : actions/setup-python@v6
69+ with :
70+ python-version : " 3.10"
71+
72+ - name : Download API reference artifact
73+ uses : actions/download-artifact@v4
74+ with :
75+ name : experimental-api-reference
76+ path : temp_api_reference
77+
78+ - name : Sync API reference
79+ run : |
80+ SOURCE_PATH="temp_api_reference"
81+ DEST_PATH="docs-website/reference/experiments-api"
82+ VERSIONED_DEST_PATH="docs-website/reference_versioned_docs"
83+
84+ echo "Syncing from $SOURCE_PATH to $DEST_PATH"
85+ mkdir -p $DEST_PATH
86+ # Using rsync to copy files. This will also remove files in dest that are no longer in source.
87+ rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$DEST_PATH/"
88+
89+ echo "Syncing to all versioned documentation paths"
90+ # Find all version directories and sync to each one
91+ for version_dir in "$VERSIONED_DEST_PATH"/version-*/experiments-api; do
92+ echo "Syncing to $version_dir"
93+ mkdir -p "$version_dir"
94+ rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$version_dir/"
95+ done
96+
97+ - name : Show Git Status
98+ run : |
99+ cd docs-website
100+ echo "=== Git Status ==="
101+ git status --porcelain
102+ echo ""
103+ echo "=== Detailed Git Status ==="
104+ git status
105+ echo ""
106+ echo "=== Files Changed ==="
107+ git diff --name-status
108+ echo ""
109+ echo "=== Diff Summary ==="
110+ git diff --stat
47111
48- # - name: Upload API reference artifact
49- # uses: actions/upload-artifact@v4
112+ # - name: Create Pull Request
113+ # uses: peter-evans/create-pull-request@v7
114+ # env:
115+ # INTEGRATION_NAME: ${{ needs.generate-api-reference.outputs.integration_name }}
50116 # with:
51- # name: ${{ steps.pathfinder.outputs.integration_name }}
52- # path: ${{ steps.pathfinder.outputs.project_path }}/${{ steps.pathfinder.outputs.integration_name }}.md
53- # if-no-files-found: error
54- # retention-days: 1
55- # overwrite: true
117+ # token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
118+ # commit-message: "Sync Core Integrations API reference (${{ env.INTEGRATION_NAME }}) on Docusaurus"
119+ # branch: sync-docusaurus-api-reference-${{ env.INTEGRATION_NAME }}
120+ # base: main
121+ # title: "docs: sync Core Integrations API reference (${{ env.INTEGRATION_NAME }}) on Docusaurus"
122+ # add-paths: |
123+ # docs-website
124+ # body: |
125+ # This PR syncs the Core Integrations API reference (${{ env.INTEGRATION_NAME }}) on Docusaurus. Just approve and merge it.
0 commit comments