-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (53 loc) · 1.53 KB
/
publish_docs.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
51
52
53
54
55
56
57
name: Publish documentation
on:
workflow_dispatch: # Allow manual triggers
push:
tags-ignore:
- '**' # Ignore any tags here
branches:
- master
#
# Trigger when either files in the docs folder,
# the requirements.txt file or the mkdocs.yml file
# are edited and commited.
paths:
- 'docs/**'
- 'requirements.txt'
- 'mkdocs.yml'
# These permissions are required for it to work
permissions:
contents: read
pages: write
id-token: write
# Makes sure only one workflow runs at a time.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
buildAndDeploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.pages_url }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Python 3.x
uses: actions/setup-python@v4
with:
python_version: '3.x' # Uses latest 3.x version.
- name: Install dependencies
# Alternatively: pip install mkdocs
run: pip install mkdocs mkdocs-material
- name: Build Docs
run: mkdocs build
- name: Configure GitHub Pages
# I have no idea if this actually needed...
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'site/' # MkDocs builds to site/ by default
- name: Deploy to GitHub Pages
id: deployment # This is required for environment
uses: actions/deploy-pages@v2