7777 name : ${{ matrix.manual.name }}
7878 path : ${{ matrix.manual.directory }}/${{ matrix.manual.build_path }}
7979
80+ # ============================================================================
81+ # BUILD EPUB
82+ # ============================================================================
83+ # Builds epub documentation for all three manuals. No LaTeX required —
84+ # runs in the same plain Python environment as build-html.
85+ # ============================================================================
86+ build-epub :
87+ name : Building ${{ matrix.manual.name }} ePub
88+ runs-on : ubuntu-latest
89+
90+ strategy :
91+ fail-fast : false
92+ matrix :
93+ manual :
94+ - name : " user_manual"
95+ directory : " user_manual"
96+ build_epub_path : " _build/epub/Nextcloud_User_Manual.epub"
97+
98+ - name : " admin_manual"
99+ directory : " admin_manual"
100+ build_epub_path : " _build/epub/Nextcloud_Server_Administration_Manual.epub"
101+
102+ - name : " developer_manual"
103+ directory : " developer_manual"
104+ build_epub_path : " _build/epub/Nextcloud_Developer_Manual.epub"
105+
106+ steps :
107+ - name : Checkout repository
108+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
109+
110+ - name : Set up Python
111+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
112+ with :
113+ python-version : " 3.13"
114+ cache : " pip"
115+
116+ - name : Install pip dependencies
117+ run : python -m pip install -r requirements.txt
118+
119+ - name : Build epub documentation
120+ run : |
121+ set -e
122+ cd ${{ matrix.manual.directory }}
123+ make epub
124+ ls -la ${{ matrix.manual.build_epub_path }}
125+
126+ - name : Upload ePub documentation
127+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
128+ with :
129+ name : ${{ matrix.manual.name }}-epub
130+ path : ${{ matrix.manual.directory }}/${{ matrix.manual.build_epub_path }}
131+
80132 # ============================================================================
81133 # PREPARE PDF IMAGE
82134 # ============================================================================
@@ -222,7 +274,7 @@ jobs:
222274 # ============================================================================
223275 stage-and-check :
224276 name : Stage and check documentation
225- needs : [build-html, build-pdf]
277+ needs : [build-html, build-pdf, build-epub ]
226278 runs-on : ubuntu-latest
227279
228280 outputs :
@@ -363,13 +415,13 @@ jobs:
363415 fi
364416 done
365417
366- # Move PDF files to the root of the branch folder for cleaner structure
367- echo "Looking for PDF files to move..."
368- find "stage/${branch}/" -maxdepth 2 -name "*.pdf" -type f
369- for pdf in "stage/${branch}"/*/*.pdf; do
370- if [ -f "$pdf " ]; then
371- echo "Moving PDF : $pdf "
372- mv "$pdf " "stage/${branch}/"
418+ # Move PDF and ePub files to the root of the branch folder for cleaner structure
419+ echo "Looking for PDF and ePub files to move..."
420+ find "stage/${branch}/" -maxdepth 2 \( -name "*.pdf" -o -name "*.epub" \) -type f
421+ for f in "stage/${branch}"/*/*.pdf "stage/${branch}"/*/*.epub ; do
422+ if [ -f "$f " ]; then
423+ echo "Moving: $f "
424+ mv "$f " "stage/${branch}/"
373425 fi
374426 done
375427
@@ -498,13 +550,13 @@ jobs:
498550 fi
499551 done
500552
501- # Move pdf files to the root of the branch folder
502- echo "Looking for PDF files to copy..."
503- find stage/${branch}/ -name "*.pdf" -type f
504- for pdf in stage/${branch}/*.pdf; do
505- if [ -f "$pdf " ]; then
506- echo "Copying PDF : $pdf "
507- cp "$pdf " server/${branch}/
553+ # Copy PDF and ePub files to the root of the branch folder
554+ echo "Looking for PDF and ePub files to copy..."
555+ find stage/${branch}/ -maxdepth 1 \( - name "*.pdf" -o -name "*.epub" \) -type f
556+ for f in stage/${branch}/*.pdf stage/${branch}/*.epub ; do
557+ if [ -f "$f " ]; then
558+ echo "Copying: $f "
559+ cp "$f " server/${branch}/
508560 fi
509561 done
510562
@@ -641,8 +693,8 @@ jobs:
641693 fi
642694 done
643695
644- # PDF files (kept at root of deploy dir)
645- find "stage/${branch}" -maxdepth 1 -name "*.pdf" -exec cp {} netlify-deploy/ \;
696+ # PDF and ePub files (kept at root of deploy dir)
697+ find "stage/${branch}" -maxdepth 1 \( -name "*.pdf" -o -name "*.epub" \) -exec cp {} netlify-deploy/ \;
646698
647699 # Minimal root index linking to the deployed content
648700 cat > netlify-deploy/index.html <<'EOF'
@@ -660,8 +712,9 @@ jobs:
660712 <li><a href="admin_manual/">Administration Manual</a></li>
661713 <li><a href="developer_manual/">Developer Manual</a></li>
662714 <li><a href="user_manual/en/">User Manual (English)</a></li>
663- <li><a href="Nextcloud_User_Manual.pdf">User Manual PDF</a></li>
664- <li><a href="Nextcloud_Server_Administration_Manual.pdf">Administration Manual PDF</a></li>
715+ <li><a href="Nextcloud_User_Manual.pdf">User Manual PDF</a> / <a href="Nextcloud_User_Manual.epub">ePub</a></li>
716+ <li><a href="Nextcloud_Server_Administration_Manual.pdf">Administration Manual PDF</a> / <a href="Nextcloud_Server_Administration_Manual.epub">ePub</a></li>
717+ <li><a href="Nextcloud_Developer_Manual.epub">Developer Manual ePub</a></li>
665718 </ul>
666719 </body>
667720 </html>
0 commit comments