chore(ci): improve docs build (#113)

* chore(ci): improve docs build

* fix(ci): trying to fix cache dir

* chore(ci): split caching in two steps
This commit is contained in:
Jérome Eertmans
2023-01-30 14:05:31 +01:00
committed by GitHub
parent f1f98bf241
commit 753f4e788b

View File

@ -6,6 +6,8 @@ on:
push:
branches: ["main"]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@ -45,17 +47,31 @@ jobs:
run: pip install manim sphinx sphinx_click furo
- name: Install local Python package
run: poetry install --with docs
- name: Restore cached media
id: cache-media-restore
uses: actions/cache/restore@v3
with:
path: media
key: ${{ runner.os }}-media
- name: Build animation and convert it into HTML slides
run: |
poetry run manim example.py ConvertExample
poetry run manim-slides convert ConvertExample docs/source/_static/slides.html -ccontrols=true
- name: Save media to cache
id: cache-media-save
uses: actions/cache/save@v3
with:
path: media
key: ${{ steps.cache-media-restore.outputs.cache-primary-key }}
- name: Build docs
run: cd docs && poetry run make html
- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v1
with:
# Upload docs/build/html dir
path: 'docs/build/html/'
- name: Deploy to GitHub Pages
id: deployment
if: github.event_name != 'pull_request'
uses: actions/deploy-pages@v1