-
Notifications
You must be signed in to change notification settings - Fork 2.8k
59 lines (49 loc) · 1.79 KB
/
docusaurus_sync.yml
File metadata and controls
59 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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"
jobs:
sync:
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- name: Checkout Haystack repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}
- 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@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
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.