-
Notifications
You must be signed in to change notification settings - Fork 67
56 lines (46 loc) · 1.48 KB
/
deploy_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
name: publish mkdocs to github pages
on:
workflow_dispatch:
push:
branches:
- unidata_20.3.2
paths:
- 'docs/**'
- 'mkdocs.yml'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python and mkdocs
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Update pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Create mkdocs_requirements.txt
run: |
echo "markdown==3.3.4" >> mkdocs_requirements.txt
echo "mkdocs==1.3.0" >> mkdocs_requirements.txt
echo "mkdocs-unidata" >> mkdocs_requirements.txt
echo "fontawesome_markdown" >> mkdocs_requirements.txt
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/mkdocs_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install python dependencies
run: python3 -m pip install -r ./mkdocs_requirements.txt
- run: mkdocs build
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site