Repository navigation
51 lines (44 loc) · 1.45 KB
/
Copy pathdocs.yml
File metadata and controls
51 lines (44 loc) · 1.45 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
# Docs: build the MkDocs Material site and deploy to GitHub Pages (gh-pages
# branch) on doc changes landing in main.
name: Docs
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'mkdocs.yml'
# The home page includes README.md through a snippet.
- 'README.md'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: write
# gh-pages is a shared branch: serialize deployments so an older run can
# never finish last and publish stale docs.
concurrency:
group: docs-deploy
cancel-in-progress: true
jobs:
deploy:
name: build and deploy docs
runs-on: ubuntu-latest
steps:
# No persisted credentials: third-party build tooling (pip packages)
# runs without a write token in .git/config. Auth happens only in the
# deploy step below.
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Build (strict, no credentials present)
run: |
pip install mkdocs-material
mkdocs build --strict
- name: Deploy to gh-pages
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
mkdocs gh-deploy --force