Skip to content

Commit d6b6bc0

Browse files
committed
updates docs CI
1 parent 059fb3b commit d6b6bc0

File tree

1 file changed

+64
-23
lines changed

1 file changed

+64
-23
lines changed

.github/workflows/docs.yml

Lines changed: 64 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
1-
name: Documentation
1+
name: "Documentation"
2+
23
on:
3-
push:
4-
paths:
5-
- 'docs/**'
6-
- 'README.md'
7-
- '.github/workflows/docs.yml'
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
schedule:
9+
- cron: '37 23 * * 2'
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
819

920
jobs:
10-
build:
11-
name: Deploy docs
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout main
15-
uses: actions/checkout@v2
16-
17-
- name: Deploy docs
18-
uses: mhausenblas/mkdocs-deploy-gh-pages@master
19-
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
# CUSTOM_DOMAIN: optionaldomain.com
23-
CONFIG_FILE: ./mkdocs.yml
24-
EXTRA_PACKAGES: build-base
25-
# GITHUB_DOMAIN: github.myenterprise.com
26-
REQUIREMENTS: docs/requirements.txt
21+
generate:
22+
name: Generate
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Restore cached venv
28+
id: cache-venv-restore
29+
uses: actions/cache/restore@v4
30+
with:
31+
path: |
32+
.cache-uv/
33+
.venv/
34+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-venv
35+
36+
- uses: yezz123/setup-uv@v4
37+
- name: Build Doc
38+
run: |
39+
uv sync --extra docs
40+
PYTHONPATH=./src uv run --cache-dir .cache-uv/ mkdocs build -d ./docs-output
41+
42+
- name: Cache venv
43+
if: steps.cache-venv-restore.outputs.cache-hit != 'true'
44+
id: cache-venv-save
45+
uses: actions/cache/save@v4
46+
with:
47+
path: |
48+
.cache-uv/
49+
.venv/
50+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-venv
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: ./docs-output
56+
57+
# Deployment job
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: generate
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)