Skip to content

Commit

Permalink
Fix docs deployment on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GenevieveBuckley committed Feb 2, 2024
1 parent 90f4f9f commit acd04e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ jobs:

# At a minimum this job should upload artifacts using actions/upload-pages-artifact
- name: Upload GitHub Pages artifact
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: |
docs/_build/
docs/_static/
docs/gallery/
path: docs/_build

- name: Deploy to GitHub Pages
id: deployment
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docs-build:
docs-xvfb:
NAPARI_CONFIG="" NAPARI_APPLICATION_IPY_INTERACTIVE=0 xvfb-run --auto-servernum sphinx-build -b html docs/ docs/_build $(SPHINXOPTS)

docs: clean docs-build
docs: clean docs-build copy-gallery-videos

# Implies noplot, but no clean - call 'make clean' manually if needed
# Autogenerated paths need to be ignored to prevent reload loops
Expand All @@ -40,3 +40,8 @@ html-noplot: clean

linkcheck-files:
NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b linkcheck -D plot_gallery=0 --color docs/ docs/_build ${FILES} $(SPHINXOPTS)

copy-gallery-videos:
rsync -rupE docs/gallery/images docs/_build/gallery

.PHONY: docs/_build/gallery
8 changes: 3 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,13 @@ def __call__(self, block, block_vars, gallery_conf):
assert os.path.exists(this_video_path)
self.video_thumbnail(this_video_path)
relative_path = (
".."
+ os.sep
+ ".."
+ os.sep
+ gallery_conf.get("gallery_dirs").strip()
"."
+ this_video_path.split(gallery_conf.get("gallery_dirs"))[
-1
].strip()
)
# Makefile copy-gallery-videos rule copies movies to _build folder
# so this relative path works correctly in the built documentation
rst += self.rst_video_template(relative_path)

# We want to display either a video OR a napari screenshot, not both!
Expand Down

0 comments on commit acd04e3

Please sign in to comment.