mirror of https://github.com/CGAL/cgal
61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/github-script@v3
|
|
id: check
|
|
with:
|
|
result-encoding: string
|
|
script: |
|
|
const labels = context.payload.pull_request.labels
|
|
names = []
|
|
for(const label of labels) {
|
|
names.push(label.name)
|
|
}
|
|
if(names.includes("small feature")) {
|
|
return 'ok'
|
|
} else {
|
|
return 'stop'
|
|
}
|
|
|
|
|
|
|
|
- name: install dependencies
|
|
if: steps.check.outputs.result == 'ok'
|
|
run: |
|
|
set -x
|
|
sudo apt-get install -y graphviz ssh
|
|
sudo pip install lxml pyquery
|
|
wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen
|
|
sudo mv doxygen_exe /usr/bin/doxygen
|
|
sudo chmod +x /usr/bin/doxygen
|
|
git config --global user.email "maxime.gimeno@geometryfactory.com"
|
|
git config --global user.name "Maxime Gimeno"
|
|
|
|
- name: configure all
|
|
if: steps.check.outputs.result == 'ok'
|
|
run: |
|
|
git clone https://maxGimeno:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git --depth=5
|
|
mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc
|
|
|
|
- name: Upload Doc
|
|
if: steps.check.outputs.result == 'ok'
|
|
run: |
|
|
set -e
|
|
PR_NUMBER=$(python -c "import json; import os; y = json.load(open(os.environ['GITHUB_EVENT_PATH'])); print(y[\"number\"])")
|
|
mkdir -p cgal.github.io/${PR_NUMBER}
|
|
cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing
|
|
cp -r ./doc_output/* ../cgal.github.io/${PR_NUMBER}/
|
|
cd ../cgal.github.io
|
|
if ! egrep -q " ${PR_NUMBER}\."; then
|
|
echo "<li><a href=https://cgal.github.io/${PR_NUMBER}/Manual/index.html>Manual for PR ${PR_NUMBER}.</a></li>" >> ./index.html
|
|
fi
|
|
git add ${PR_NUMBER} && git commit -a -m "Add ${PR_NUMBER}" && git push -u origin master
|