-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (52 loc) · 1.55 KB
/
Copy pathdocs.yml
File metadata and controls
66 lines (52 loc) · 1.55 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
60
61
62
63
64
65
66
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- "requirements-docs.txt"
- "README.md"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
- "CNAME"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
deploy:
name: Build and deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
- name: Install docs dependencies
run: |
pip install -r requirements-docs.txt
pip install -e "."
- name: Configure git for gh-deploy
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Assemble docs build directory
run: |
BUILD=.docs_build
mkdir -p $BUILD
if [ -d docs ]; then cp -r docs $BUILD/docs; fi
for fname in README.md CHANGELOG.md CONTRIBUTING.md CNAME; do
if [ -f "$fname" ]; then cp "$fname" "$BUILD/$fname"; fi
done
echo "Build dir contains $(find $BUILD -type f | wc -l) files"
- name: Generate build config
run: |
sed 's|^docs_dir: \.$|docs_dir: .docs_build|' mkdocs.yml > .mkdocs_build.yml
- name: Build and deploy to GitHub Pages
run: mkdocs gh-deploy --force --clean --config-file .mkdocs_build.yml