Skip to content

Commit 0a8b329

Browse files
ilariaeIlaria Enache
andauthored
add mkdocs build workflow (polkadot-developers#224)
Co-authored-by: Ilaria Enache <[email protected]>
1 parent b28f36a commit 0a8b329

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CheckMkDocsBuild
2+
on:
3+
# Trigger the workflow on a new pull request on master
4+
pull_request_target:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-docs-site:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.10.12'
16+
17+
- name: Allow to move dotfiles
18+
run: |
19+
# move also dotfile with *
20+
shopt -s dotglob
21+
22+
- name: Clone Moonbeam MKDocs
23+
run: |
24+
# clone mkdocs repo locally
25+
git clone https://${{ secrets.REPO_SCOPED_TOKEN }}@github.com/papermoonio/polkadot-mkdocs
26+
27+
- name: Move polkadot-docs contents to mkdocs repository
28+
run: |
29+
mkdir polkadot-mkdocs/polkadot-docs
30+
find . -mindepth 1 -maxdepth 1 ! -name 'polkadot-mkdocs' -exec mv {} polkadot-mkdocs/polkadot-docs/ \;
31+
32+
- name: Install pip requirements
33+
run: |
34+
cd polkadot-mkdocs
35+
# upgrade pip
36+
pip3 install --upgrade pip setuptools==65.7.0
37+
# install dependencies quietly
38+
pip3 install -r requirements.txt &> /dev/null && echo "Dependencies installed" || echo "Error while installing dependencies"
39+
40+
- name: Build mkdocs
41+
run: |
42+
cd polkadot-mkdocs
43+
# change destination build folder in mkdocs YAML to local site/
44+
sed -i 's/site_dir.*/site_dir: site/' mkdocs.yml
45+
# build project
46+
python3 -m mkdocs build

0 commit comments

Comments
 (0)