-
-
Notifications
You must be signed in to change notification settings - Fork 57
45 lines (38 loc) · 1.26 KB
/
docs.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
name: website
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/checkout@v4
with:
ref: master
- name: Run `pdoc` on branch master
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry run pdoc tradingview_screener/ -o /tmp/docs -t templates/
- uses: actions/checkout@v4
with:
ref: docs
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Move generated docs from temp directory to branch `docs`, and commit (branch docs contains a folder named docs)
run: |
mkdir -p ./docs/dev
cp -r /tmp/docs/* ./docs/dev
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git status
if [ -n "$(git status --porcelain)" ]; then
git commit -a -m "Generated docs for latest dev version"
git push
else
echo "No changes"
fi