From cd37b5c1630ec648105c1a37ef1e80040838e67f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 17 Sep 2024 22:07:37 +0300 Subject: [PATCH] Build PDF and EPUB book --- .github/workflows/publish-latest.yml | 19 +++++++++++-------- content/courses/intro-to-ada-ukr/index.rst | 4 ++-- frontend/sphinx/conf_patch_ukr.py | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml index df4f76aa9..9518d0eae 100644 --- a/.github/workflows/publish-latest.yml +++ b/.github/workflows/publish-latest.yml @@ -1,6 +1,6 @@ name: Build Sphinx Books -on: [workflow_dispatch] +on: [push] defaults: run: @@ -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 dist/pdf_books dist/epub_books dist/html + - name: Upload to page artifact uses: actions/upload-pages-artifact@v3.0.1 with: - path: frontend/dist/html/ + path: frontend/dist/html deploy: permissions: diff --git a/content/courses/intro-to-ada-ukr/index.rst b/content/courses/intro-to-ada-ukr/index.rst index 1b0c347a4..7a6f820f6 100644 --- a/content/courses/intro-to-ada-ukr/index.rst +++ b/content/courses/intro-to-ada-ukr/index.rst @@ -112,11 +112,11 @@ .. raw:: html - + Download PDF - + Download EPUB diff --git a/frontend/sphinx/conf_patch_ukr.py b/frontend/sphinx/conf_patch_ukr.py index 588368e61..58aa8d6e5 100644 --- a/frontend/sphinx/conf_patch_ukr.py +++ b/frontend/sphinx/conf_patch_ukr.py @@ -2,7 +2,7 @@ exclude_patterns += [ 'about.rst', - 'index.rst', + './index.rst', '**/README.md' ]