Skip to content

Commit

Permalink
render notebooks when building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Dec 4, 2024
1 parent abe6317 commit f709c65
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 1,663 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,28 @@ jobs:
git config --global user.email "[email protected]"
# Checkout gh-pages branch
git restore uv.lock
git restore .
git fetch origin gh-pages --depth=1
git checkout gh-pages
# Create preview directory if it doesn't exist
mkdir -p pr-previews
# Check if there are actual changes in the built site
if [ -d "pr-previews/pr-${{ github.event.pull_request.number }}" ]; then
diff -r site/pr-${{ github.event.pull_request.number }} pr-previews/pr-${{ github.event.pull_request.number }} > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "No changes in documentation. Skipping deployment."
exit 0
fi
fi
# Remove old preview if it exists
rm -rf pr-previews/pr-${{ github.event.pull_request.number }}
# Copy new preview
rm -rf pr-previews/pr-${{ github.event.pull_request.number }}
cp -r site/pr-${{ github.event.pull_request.number }} pr-previews/
# Commit and push
# Check if there are actual changes in git
git add pr-previews
git commit -m "Deploy preview for PR #${{ github.event.pull_request.number }}" || echo "No changes to commit"
git diff --staged --quiet || git push origin gh-pages
if git diff --staged --quiet; then
echo "No changes in documentation. Skipping deployment."
echo "has_changes=false" >> $GITHUB_OUTPUT
exit 0
fi
# If we get here, there are changes
git commit -m "Deploy preview for PR #${{ github.event.pull_request.number }}"
git push origin gh-pages
echo "has_changes=true" >> $GITHUB_OUTPUT
- name: Post/Update PR Review
Expand Down
409 changes: 20 additions & 389 deletions docs/examples/rasterio_backend_example.ipynb

Large diffs are not rendered by default.

579 changes: 28 additions & 551 deletions docs/examples/time_series_example.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit f709c65

Please sign in to comment.