-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.62 KB
/
update-gh-pages.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
# Copyright (c) 2023-2024 tracetronic GmbH
#
# SPDX-License-Identifier: MIT
name: Update GitHub Pages
on:
push:
branches:
- main
jobs:
update_gh_pages:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install poetry
run: pip3 install poetry
- name: Install dependencies
run: poetry install --only dev,docs
- name: Create Sphinx documentation
run: |
mkdir docs/docs
poetry run sphinx-apidoc -f -o ./docs/source ./testguide_report_generator
poetry run sphinx-build -b html ./docs/source ./docs/docs
rm -r docs/source
- name: Copy additional documentation resources into docs folder
run: |
cp -f README.md docs/README.md
cp -f LICENSE docs/LICENSE
cp -f -R docs/images docs/docs/images
- name: Publish GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
clean: true
- name: Create .nojekyll file to avoid Jekyll processing
run: |
git checkout gh-pages
git pull
if [ -f "docs/.nojekyll" ]; then
echo ".nojekyll already exists. Exiting."
exit 0
fi
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
touch docs/.nojekyll
git add docs/.nojekyll
git commit --signoff -m "Add .nojekyll file"
git push