-
Notifications
You must be signed in to change notification settings - Fork 17
97 lines (82 loc) · 3.02 KB
/
website.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Website
on:
push:
pull_request:
branches:
- master
- devel
jobs:
website:
name: Build and Deploy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
- run: git fetch --prune --unshallow
- name: Inspect Environment
run: |
env | grep ^GITHUB
cat ${GITHUB_EVENT_PATH}
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Install website dependecies
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz texlive-font-utils
pip install "tornado<6.0" mkdocs Pygments mkdocs-material
- name: Generate documentation
run: |
mkdir build
cd build
cmake .. -G"Unix Makefiles" -DWBT_BUILD_DOCS:BOOL=TRUE
make dox
make mkdocs
- name: Clone gh-pages
run: |
git ls-remote --heads --exit-code https://github.com/robotology/wb-toolbox gh-pages
git clone -b gh-pages --depth=1 https://github.com/robotology/wb-toolbox ${GH_PAGES_ROOTDIR}
rm -rf ${GH_PAGES_ROOTDIR}/.git
echo "GH_PAGES_ROOTDIR=${GITHUB_WORKSPACE}/${GH_PAGES_ROOTDIR}" >> $GITHUB_ENV
env:
GH_PAGES_ROOTDIR: build/ghpages
- name: Select deploy folder [master]
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'refs/heads/master')
run: echo "DEPLOY_FOLDER=${GH_PAGES_ROOTDIR}" >> $GITHUB_ENV
- name: Select deploy folder [other]
if: |
(github.event_name == 'push' && github.ref != 'refs/heads/master') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.ref != 'refs/heads/master')
run: echo "DEPLOY_FOLDER=${GH_PAGES_ROOTDIR}/devel" >> $GITHUB_ENV
- name: Prepare deploy folder
run: |
mkdir -p $DEPLOY_FOLDER
cd $GH_PAGES_ROOTDIR
touch .nojekyll
- name: Populate deploy folder
run: |
cp doc/index.html $DEPLOY_FOLDER/index.html
rm -rf $DEPLOY_FOLDER/mkdocs
rm -rf $DEPLOY_FOLDER/doxygen
cp -r $MKDOCS_INPUT_FOLDER $DEPLOY_FOLDER/mkdocs
cp -r $DOXYGEN_INPUT_FOLDER/html $DEPLOY_FOLDER/doxygen
env:
MKDOCS_INPUT_FOLDER: build/doc/mkdocs
DOXYGEN_INPUT_FOLDER: build/doc/doxygen
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
if: |
github.event_name == 'push' &&
github.repository == 'robotology/wb-toolbox' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel')
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: build/ghpages
CLEAN: true
CLEAN_EXCLUDE: '[".gitignore", ".nojekyll"]'