-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (44 loc) · 1.28 KB
/
documentation.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
name: Deploy Documentation
on:
push:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'requirements.txt' # Added this to trigger on requirements changes
- '.github/workflows/documentation.yml'
workflow_dispatch: # Allow manual triggering
pull_request:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'requirements.txt' # Added this to trigger on requirements changes
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip' # Enable built-in pip caching
- name: Install dependencies
run: pip install -r 'requirements.txt'
- name: Build documentation
if: github.event_name == 'pull_request'
run: mkdocs build
- name: Deploy documentation
if: github.event_name != 'pull_request'
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
mkdocs gh-deploy --force --remote-branch gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}