Skip to content

Commit da891c6

Browse files
committed
[ci] Fix docs-all job running out of disk space
1 parent 6da7477 commit da891c6

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,42 @@ jobs:
5353
5454
# Niklas: Running on the old container until I can figure out why the doc generator hangs
5555
api-docs-all:
56-
runs-on: ubuntu-24.04
57-
container:
58-
image: ghcr.io/modm-ext/modm-build-base:2022-09-27
56+
runs-on: ubuntu-latest
5957
steps:
58+
- name: Free up disk space
59+
run: |
60+
df -h
61+
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
62+
sudo docker image prune --all --force
63+
df -h
64+
6065
- name: Check out repository
6166
uses: actions/checkout@v4
6267
with:
6368
submodules: 'recursive'
64-
- name: Fix Git permission/ownership problem
65-
run: |
66-
git config --global --add safe.directory /__w/modm/modm
67-
- name: Update lbuild
68-
run: |
69-
pip3 install --upgrade --upgrade-strategy=eager modm
70-
- name: Full run of docs.modm.io-generator-script
71-
run: |
72-
export TERM=xterm-256color
73-
export COLUMNS=120
74-
python3 tools/scripts/docs_modm_io_generator.py -c -j4 -d
75-
- name: Size of documentation archive
76-
if: always()
77-
run: |
78-
ls -lh modm-api-docs.tar.gz
79-
- name: Upload api documentation to docs.modm.io
80-
if: always()
69+
70+
- name: Build Documentation inside Container
8171
env:
8272
DOCS_MODM_IO_UPLOAD: ${{ secrets.DOCS_MODM_IO_UPLOAD }}
8373
run: |
84-
curl https://docs.modm.io/upload/compressed --upload-file modm-api-docs.tar.gz --user $DOCS_MODM_IO_UPLOAD
74+
# We mount the current working directory into the container
75+
# and run the build commands as a single bash sequence.
76+
docker run --rm \
77+
-v ${{ github.workspace }}:/github/workspace \
78+
-w /github/workspace \
79+
-e DOCS_MODM_IO_UPLOAD="$DOCS_MODM_IO_UPLOAD" \
80+
ghcr.io/modm-ext/modm-build-base:2022-09-27 \
81+
/bin/bash -c "
82+
git config --global --add safe.directory /github/workspace && \
83+
pip3 install --upgrade --upgrade-strategy=eager modm && \
84+
export TERM=xterm-256color && \
85+
export COLUMNS=120 && \
86+
python3 tools/scripts/docs_modm_io_generator.py -c -j4 -d && \
87+
curl https://docs.modm.io/upload/compressed --upload-file modm-api-docs.tar.gz --user \$DOCS_MODM_IO_UPLOAD
88+
"
89+
90+
- name: Final Disk Check
91+
if: always()
92+
run: |
93+
df -h
94+
ls -lh modm-api-docs.tar.gz || true

0 commit comments

Comments
 (0)