-
Notifications
You must be signed in to change notification settings - Fork 79
53 lines (49 loc) · 1.5 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
53 lines (49 loc) · 1.5 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
name: Deploy MkDocs
on:
push:
branches:
- main
paths:
- 'mkdocs.yml'
- 'docs/**'
- '.github/docs-requirements.txt'
- '.github/workflows/deploy-docs.yml'
# Pages is served from the Actions artifact, so nothing here needs to push to
# the repository: a compromised docs dependency gets no write access.
permissions:
contents: read
pages: write
id-token: write
# One deploy at a time, and never cancel one midway.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install -r .github/docs-requirements.txt
- run: mkdocs build
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0