-
Notifications
You must be signed in to change notification settings - Fork 167
94 lines (87 loc) · 3.12 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
94 lines (87 loc) · 3.12 KB
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
name: Build and deploy docs
on:
push:
branches:
- develop
- develop-**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-upload-docs:
runs-on: ubuntu-24.04
container:
image: ghcr.io/modm-ext/modm-build-base:2025-05-18
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Fix Git permission/ownership problem
run: |
git config --global --add safe.directory /__w/modm/modm
- name: Update lbuild
run: |
pip3 install --upgrade --upgrade-strategy=eager --break-system-packages modm
- name: Mkdocs info
run: |
mkdocs --version
pip3 show mkdocs-material
- name: Clone modm-ext/modm.io repository
uses: actions/checkout@v4
with:
repository: modm-ext/modm.io
ssh-key: ${{secrets.MODM_EXT_MODM_IO_DEPLOY_KEY}}
path: docs/modm.io
- name: Build Homepage
run: |
rm -rf docs/modm.io/docs/*
python3 tools/scripts/synchronize_docs.py
python3 tools/scripts/generate_module_docs.py
(cd docs && mkdocs build)
- name: Push New Docs to Github
run: |
cd docs/modm.io
git config user.email "bot@modm.io"
git config user.name "modm bot"
git add -A
git diff-index --quiet HEAD || git commit -m "Update"
git push origin master
# Niklas: Running on the old container until I can figure out why the doc generator hangs
api-docs-all:
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
df -h
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
df -h
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build Documentation inside Container
env:
DOCS_MODM_IO_UPLOAD: ${{ secrets.DOCS_MODM_IO_UPLOAD }}
run: |
# We mount the current working directory into the container
# and run the build commands as a single bash sequence.
docker run --rm \
-v ${{ github.workspace }}:/github/workspace \
-w /github/workspace \
-e DOCS_MODM_IO_UPLOAD="$DOCS_MODM_IO_UPLOAD" \
ghcr.io/modm-ext/modm-build-base:2022-09-27 \
/bin/bash -c "
git config --global --add safe.directory /github/workspace && \
pip3 install --upgrade --upgrade-strategy=eager modm && \
export TERM=xterm-256color && \
export COLUMNS=120 && \
python3 tools/scripts/docs_modm_io_generator.py -c -j4 -d && \
curl https://docs.modm.io/upload/compressed --upload-file modm-api-docs.tar.gz --user \$DOCS_MODM_IO_UPLOAD
"
- name: Final Disk Check
if: always()
run: |
df -h
ls -lh modm-api-docs.tar.gz || true