Skip to content

Commit f7539b5

Browse files
authored
update build workflow
1 parent 6143631 commit f7539b5

File tree

1 file changed

+12
-43
lines changed

1 file changed

+12
-43
lines changed
Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,15 @@
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-latest
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
1+
name: PR Docs Build
212

22-
- name: Clone Polkadot 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/ \;
3+
on:
4+
pull_request:
315

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"
6+
permissions:
7+
contents: read
398

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
9+
jobs:
10+
build-docs:
11+
uses: papermoonio/workflows/.github/workflows/core-pr-mkdocs-build.yml@main
12+
with:
13+
mkdocs_repo: papermoonio/polkadot-mkdocs
14+
docs_repo: polkadot-developers/polkadot-docs
15+
docs_checkout: polkadot-docs

0 commit comments

Comments
 (0)