-
Notifications
You must be signed in to change notification settings - Fork 127
60 lines (53 loc) · 1.82 KB
/
CI_readme_sync.yml
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
60
name: Sync docs with Readme
on:
push:
branches:
- main
- massi/readme-sync
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U haystack-pydoc-tools
# We look into the changeset in order to understand
# which integrations were modified by the last commit.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
# Output unique changed directories instead of filenames
dir_names: true
# Ingnore CWD (.)
dir_names_exclude_current_dir: true
# We only care about the name of the integration, i.e. integrations/FOO
dir_names_max_depth: 2
separator: '\n'
- name: Generate docs
env:
# This is necessary to fetch the documentation categories
# from Readme.io as we need them to associate the slug
# in config files with their id.
README_API_KEY: ${{ secrets.README_API_KEY }}
ALL_CHANGED_DIRS: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for d in "$ALL_CHANGED_DIRS"; do
echo "$d was changed"
done
- name: Sync preview docs with 2.0
# Sync the preview docs to the `2.0` version on Readme
id: sync-main
if: github.ref_name == 'main' && github.event_name == 'push'
uses: readmeio/[email protected]
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
with:
rdme: docs ./docs/pydoc/temp --key="$README_API_KEY" --version=2.0