-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (59 loc) · 2.06 KB
/
docsite.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
name: Deploy Doc Site
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache apt-pkgs
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ffmpeg sox libavdevice-dev graphviz
version: 1.0
- name: Dot register
run: sudo dot -c
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
save-always: true
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r requirements.txt
- name: Generate modules
run: python ./doc/generate_modules.py src/waloviz -d ./doc/reference-manual -n waloviz -e tests
- name: Build site
run: nbsite build --org AlonKellner --project-name waloviz
- name: Copy site root ➜
run: cp -r doc/site_root/. builtdocs/
- name: Push to docsite
run: |
git config --global user.name '${{ github.repository_owner }}'
git config --global user.email '${{ vars.OWNER_EMAIL }}'
git_hash=$(git rev-parse --short "$GITHUB_SHA")
git_branch=${GITHUB_REF#refs/heads/}
git fetch
git switch docsite
find . -mindepth 1 -regextype posix-egrep ! -regex '(^\.\/\.git.*)|(^\.\/builtdocs.*)' -delete
cp -r builtdocs/. ./
rm -r builtdocs
git add .
git commit -am "Deploying site from ${git_branch}@${git_hash}"
git push