66 branches :
77 - master
88 - stable*
9+ schedule :
10+ - cron : ' 0 2 * * *' # 02:00 UTC daily — full build + deploy
911
1012permissions :
1113 contents : read
7779 name : ${{ matrix.manual.name }}
7880 path : ${{ matrix.manual.directory }}/${{ matrix.manual.build_path }}
7981
82+ # ============================================================================
83+ # BUILD EPUB
84+ # ============================================================================
85+ # Builds epub documentation for all three manuals. No LaTeX required —
86+ # runs in the same plain Python environment as build-html.
87+ # ============================================================================
88+ build-epub :
89+ name : Building ${{ matrix.manual.name }} ePub
90+ runs-on : ubuntu-latest
91+
92+ strategy :
93+ fail-fast : false
94+ matrix :
95+ manual :
96+ - name : " user_manual"
97+ directory : " user_manual"
98+ build_epub_path : " _build/epub/Nextcloud_User_Manual.epub"
99+
100+ - name : " admin_manual"
101+ directory : " admin_manual"
102+ build_epub_path : " _build/epub/Nextcloud_Server_Administration_Manual.epub"
103+
104+ - name : " developer_manual"
105+ directory : " developer_manual"
106+ build_epub_path : " _build/epub/Nextcloud_Developer_Manual.epub"
107+
108+ steps :
109+ - name : Checkout repository
110+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
111+
112+ - name : Set up Python
113+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
114+ with :
115+ python-version : " 3.13"
116+ cache : " pip"
117+
118+ - name : Install pip dependencies
119+ run : python -m pip install -r requirements.txt
120+
121+ - name : Build epub documentation
122+ run : |
123+ set -e
124+ cd ${{ matrix.manual.directory }}
125+ make epub
126+ ls -la ${{ matrix.manual.build_epub_path }}
127+
128+ - name : Upload ePub documentation
129+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
130+ with :
131+ name : ${{ matrix.manual.name }}-epub
132+ path : ${{ matrix.manual.directory }}/${{ matrix.manual.build_epub_path }}
133+
80134 # ============================================================================
81135 # PREPARE PDF IMAGE
82136 # ============================================================================
@@ -222,7 +276,7 @@ jobs:
222276 # ============================================================================
223277 stage-and-check :
224278 name : Stage and check documentation
225- needs : [build-html, build-pdf]
279+ needs : [build-html, build-pdf, build-epub ]
226280 runs-on : ubuntu-latest
227281
228282 outputs :
@@ -363,13 +417,13 @@ jobs:
363417 fi
364418 done
365419
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}/"
420+ # Move PDF and ePub files to the root of the branch folder for cleaner structure
421+ echo "Looking for PDF and ePub files to move..."
422+ find "stage/${branch}/" -maxdepth 2 \( -name "*.pdf" -o -name "*.epub" \) -type f
423+ for f in "stage/${branch}"/*/*.pdf "stage/${branch}"/*/*.epub ; do
424+ if [ -f "$f " ]; then
425+ echo "Moving: $f "
426+ mv "$f " "stage/${branch}/"
373427 fi
374428 done
375429
@@ -453,7 +507,7 @@ jobs:
453507 deploy :
454508 name : Deploy documentation for gh-pages
455509 needs : stage-and-check
456- if : github.event_name == 'push '
510+ if : github.event_name == 'schedule '
457511 runs-on : ubuntu-latest
458512
459513 permissions :
@@ -498,13 +552,13 @@ jobs:
498552 fi
499553 done
500554
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}/
555+ # Copy PDF and ePub files to the root of the branch folder
556+ echo "Looking for PDF and ePub files to copy..."
557+ find stage/${branch}/ -maxdepth 1 \( - name "*.pdf" -o -name "*.epub" \) -type f
558+ for f in stage/${branch}/*.pdf stage/${branch}/*.epub ; do
559+ if [ -f "$f " ]; then
560+ echo "Copying: $f "
561+ cp "$f " server/${branch}/
508562 fi
509563 done
510564
@@ -641,8 +695,8 @@ jobs:
641695 fi
642696 done
643697
644- # PDF files (kept at root of deploy dir)
645- find "stage/${branch}" -maxdepth 1 -name "*.pdf" -exec cp {} netlify-deploy/ \;
698+ # PDF and ePub files (kept at root of deploy dir)
699+ find "stage/${branch}" -maxdepth 1 \( -name "*.pdf" -o -name "*.epub" \) -exec cp {} netlify-deploy/ \;
646700
647701 # Minimal root index linking to the deployed content
648702 cat > netlify-deploy/index.html <<'EOF'
@@ -660,8 +714,9 @@ jobs:
660714 <li><a href="admin_manual/">Administration Manual</a></li>
661715 <li><a href="developer_manual/">Developer Manual</a></li>
662716 <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>
717+ <li><a href="Nextcloud_User_Manual.pdf">User Manual PDF</a> / <a href="Nextcloud_User_Manual.epub">ePub</a></li>
718+ <li><a href="Nextcloud_Server_Administration_Manual.pdf">Administration Manual PDF</a> / <a href="Nextcloud_Server_Administration_Manual.epub">ePub</a></li>
719+ <li><a href="Nextcloud_Developer_Manual.epub">Developer Manual ePub</a></li>
665720 </ul>
666721 </body>
667722 </html>
@@ -802,7 +857,11 @@ jobs:
802857 then
803858 echo "This workflow ran for a pull request. We need stage-and-check and link-check to succeed, deploy must be skipped, and netlify-preview must succeed or fail (non-fatal on forks)"
804859 if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'skipped' || (needs.netlify-preview.result != 'success' && needs.netlify-preview.result != 'failure') }}; then exit 1; fi
860+ elif ${{ github.event_name == 'push' }}
861+ then
862+ echo "This workflow ran for a push. We need stage-and-check and link-check to succeed; deploy and netlify-preview must be skipped"
863+ if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'skipped' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
805864 else
806- echo "This workflow ran for a push . We need stage-and-check, link-check, and deploy to succeed; netlify-preview must be skipped"
865+ echo "This workflow ran on schedule . We need stage-and-check, link-check, and deploy to succeed; netlify-preview must be skipped"
807866 if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'success' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
808867 fi
0 commit comments