-
Notifications
You must be signed in to change notification settings - Fork 156
76 lines (63 loc) · 2 KB
/
doc-deploy.yml
File metadata and controls
76 lines (63 loc) · 2 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
67
68
69
70
71
72
73
74
75
76
name: Build and Deploy MkDocs
on:
push:
branches:
- master
paths:
- docs/** # Any change in documentation
- .github/workflows/doc-deploy.yml # Any change in this workflow
# Set required permissions for GitHub Pages deployment
permissions:
contents: read # Allow reading repository contents
pages: write # Allow writing to GitHub Pages
id-token: write # Required for OIDC authentication to deploy
# Avoid concurrent deployments on the same branch
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository at the pushed commit
- name: Checkout repository
uses: actions/checkout@v4
# Setup Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
# Install Python dependencies for MkDocs
- name: Install dependencies
run: |
echo "Installing MkDocs dependencies"
pip install -r docs/requirements.txt
# Build MkDocs site
- name: Build MkDocs site
run: |
echo "Building MkDocs site"
cd docs
# Clean previous 'master' build
rm -rf site/master
# Build the site into 'site/master'
mkdocs build --site-dir site/master
# Upload the built static files as an artifact for GitHub Pages
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
# Path to the directory containing the built site
path: docs/site
deploy:
# Ensure 'deploy' only runs after 'build' completes successfully
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
steps:
# Deploy the uploaded artifact to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4