Skip to content

Commit

Permalink
Build PDF and EPUB book
Browse files Browse the repository at this point in the history
  • Loading branch information
reznikmm committed Sep 17, 2024
1 parent 74eddb4 commit fbcd2dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build Sphinx Books

on: [workflow_dispatch]
on: [push]

defaults:
run:
Expand Down Expand Up @@ -74,33 +74,36 @@ jobs:
run: make cleanall webpack-production sphinx-production
# - name: Run SPHINX content tests
# run: make -k HIDDEN_BOOKS=$HIDDEN_BOOKS HIDDEN_CONTENTS="" test_all_content
# - name: Build PDF books including build/runtime output
# run: make HIDDEN_BOOKS=$HIDDEN_BOOKS HIDDEN_CONTENTS="" pdf_books
- name: Build PDF books including build/runtime output
run: make HIDDEN_BOOKS=$HIDDEN_BOOKS HIDDEN_CONTENTS="" pdf_books
- name: Archive PDF books in artifact
uses: actions/upload-artifact@v4
with:
name: learn-pdf-books
path: |
frontend/dist/pdf_books
# if-no-files-found: error
if-no-files-found: error
retention-days: 1
compression-level: 9
# - name: Build EPUB books including build/runtime output
# run: make HIDDEN_BOOKS=$HIDDEN_BOOKS HIDDEN_CONTENTS="" epub_books
- name: Build EPUB books including build/runtime output
run: make HIDDEN_BOOKS=$HIDDEN_BOOKS HIDDEN_CONTENTS="" epub_books
- name: Archive EPUB books in artifact
uses: actions/upload-artifact@v4
with:
name: learn-epub-books
path: |
frontend/dist/epub_books
# if-no-files-found: error
if-no-files-found: error
retention-days: 1
compression-level: 9

- name: Move books into html/
run: mv -v frontend/dist/pdf_books frontend/dist/epub_books frontend/dist/html

- name: Upload to page artifact
uses: actions/[email protected]
with:
path: frontend/dist/html/
path: frontend/dist/html

deploy:
permissions:
Expand Down
4 changes: 2 additions & 2 deletions content/courses/intro-to-ada-ukr/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@

.. raw:: html

<a class="ebook-download-button" href="/pdf_books/courses/intro-to-ada-ua.pdf">
<a class="ebook-download-button" href="/pdf_books/courses/intro-to-ada-ukr.pdf">
Download PDF
</a>

<a class="ebook-download-button" href="/epub_books/courses/intro-to-ada-ua.epub">
<a class="ebook-download-button" href="/epub_books/courses/intro-to-ada-ukr.epub">
Download EPUB
</a>

Expand Down
2 changes: 1 addition & 1 deletion frontend/sphinx/conf_patch_ukr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exclude_patterns += [
'about.rst',
'index.rst',
'./index.rst',
'**/README.md'
]

Expand Down

0 comments on commit fbcd2dc

Please sign in to comment.