-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (38 loc) · 1.4 KB
/
publish.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
name: Build and Deploy MkDocs
on:
push:
branches:
- docs # Trigger on pushes to the docs branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8' # Use the desired Python version
- name: Install dependencies
run: |
pip install -r requirements.txt # Install dependencies from requirements.txt
- name: Build documentation
run: mkdocs build # Build the documentation
- name: Checkout site branch
run: |
git checkout site # Switch to the site branch
git config user.name "GitHub Action"
git config user.email "[email protected]"
- name: Replace site contents
run: |
rm -rf * # Remove existing files in the site branch
echo "google-site-verification: googlee5febdfb3cd460f8.html" > googlee5febdfb3cd460f8.html
mv ../site/* ./ # Move new files from the build directory to the site branch
- name: Commit changes
run: |
git add .
git commit -m "Update documentation" || echo "No changes to commit"
- name: Push changes
run: git push origin site # Push changes to the site branch