-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (40 loc) · 1.44 KB
/
check-mkdocs-build.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
name: CheckMkDocsBuild
on:
# Trigger the workflow on a new pull request on master
pull_request_target:
branches:
- master
jobs:
build-docs-site:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Allow to move dotfiles
run: |
# move also dotfile with *
shopt -s dotglob
- name: Clone Polkadot MKDocs
run: |
# clone mkdocs repo locally
git clone https://${{ secrets.REPO_SCOPED_TOKEN }}@github.com/papermoonio/polkadot-mkdocs
- name: Move polkadot-docs contents to mkdocs repository
run: |
mkdir polkadot-mkdocs/polkadot-docs
find . -mindepth 1 -maxdepth 1 ! -name 'polkadot-mkdocs' -exec mv {} polkadot-mkdocs/polkadot-docs/ \;
- name: Install pip requirements
run: |
cd polkadot-mkdocs
# upgrade pip
pip3 install --upgrade pip setuptools==65.7.0
# install dependencies quietly
pip3 install -r requirements.txt &> /dev/null && echo "Dependencies installed" || echo "Error while installing dependencies"
- name: Build mkdocs
run: |
cd polkadot-mkdocs
# change destination build folder in mkdocs YAML to local site/
sed -i 's/site_dir.*/site_dir: site/' mkdocs.yml
# build project
python3 -m mkdocs build