Skip to content

Commit fd9f5d7

Browse files
committed
Add workflow to create documentation artifacts
- enabled instead of docbuild (excludes push on master) - allows to download an archive of the generated html (artifacts seem only to come as zip archives for GH actions)
1 parent 2d596f2 commit fd9f5d7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: DocArtifacts
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
pull_request:
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
build_docs:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
python-version: [3.8]
19+
steps:
20+
- name: Checkout master
21+
uses: actions/checkout@v2
22+
with:
23+
path: main
24+
- name: Check for documentation changes
25+
run: |
26+
cd main
27+
echo "LAST_COMMIT=$(echo `git log -1 --pretty=%B`)" >> $GITHUB_ENV
28+
echo "LAST_DOC_COMMIT=$(echo `git log -1 --pretty=%B docs`)" >> $GITHUB_ENV
29+
if [ "$LAST_COMMIT" != "$LAST_DOC_COMMIT" ]; then
30+
echo "No changes in documentation, skipping"
31+
exit 0
32+
fi
33+
- name: Install needed packages
34+
run: |
35+
pip3 install wheel
36+
pip3 install pytest
37+
sudo apt update
38+
sudo apt-get install python3-sphinx
39+
cd main/docs
40+
make html
41+
- name: Checkout gh-pages
42+
uses: actions/checkout@v2
43+
with:
44+
ref: gh-pages
45+
path: doc
46+
- name: Upload documentation artifatcs
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: DocumentationPages
50+
path: main/docs/build/html/*

0 commit comments

Comments
 (0)