-
Notifications
You must be signed in to change notification settings - Fork 445
81 lines (66 loc) · 2.08 KB
/
docs.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
name: Docs Deployment
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Generate Docs
shell: bash
run: |
# Install pip dependencies, build builtin gar, and generate proto stuffs.
sudo apt update
sudo apt install -y doxygen graphviz
# generate a tagged version
cd ${GITHUB_WORKSPACE}
make graphscope-docs
# generate a stable version
tag=$(git describe --exact-match --tags HEAD 2>/dev/null || true)
if [ ! -z "$tag" ];
then
export TAG_VER=stable
make graphscope-docs
fi
- name: Upload Docs
if: ${{ github.repository == 'alibaba/GraphScope' }}
shell: bash
run: |
shopt -s extglob
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
tag=$(git describe --exact-match --tags HEAD 2>/dev/null || true)
git fetch origin gh-pages --no-recurse-submodules
git checkout gh-pages
cd docs/
if [ -d "_build/latest" ];
then
rm -rf latest
cp -R _build/latest/html ./latest
else
rm -rf latest
cp -R _build/${tag}/html ./latest
rm -rf ${tag}
cp -R _build/${tag}/html ./${tag}
fi
if [ -d "_build/stable" ];
then
rm -rf !(_build|latest|stable|v*)
cp -R _build/stable/html/* ./
fi
rm -rf _build/
rm -rf ../flex/ || true
rm -rf ../learning_engine/ || true
rm -rf ../python || true
rm -rf ../analytical_engine/java || true
git add -A
git commit --amend --no-edit -m "Generate latest docs on CI, from commit ${{ github.sha }}." --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" -s --date="$(date -R)"
git push -f origin gh-pages