Skip to content

Commit 547631c

Browse files
committed
Deploy previews on RTD
1 parent c6b881b commit 547631c

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

.github/workflows/rtd-preview.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: RTD Preview
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
binder:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Comment on the PR with the RTD preview
14+
uses: actions/github-script@v6
15+
with:
16+
github-token: ${{secrets.GITHUB_TOKEN}}
17+
script: |
18+
var PR_NUMBER = context.issue.number
19+
github.rest.issues.createComment({
20+
issue_number: context.issue.number,
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
body: `[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jupyterlab-hybrid-kernels--${PR_NUMBER}.org.readthedocs.build/en/${PR_NUMBER}) :point_left: Try it on ReadTheDocs`
24+
})

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,7 @@ dmypy.json
126126

127127
# Jupyter Notebooks
128128
[Uu]ntitled*
129+
130+
# JupyterLite
131+
.jupyterlite.doit.db
132+
_output/

.readthedocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: mambaforge-latest
7+
commands:
8+
- mamba env update --name base --file docs/environment.yml
9+
- python -m pip install .
10+
- jupyter lite build --output-dir dist
11+
- mkdir -p $READTHEDOCS_OUTPUT/html
12+
- cp -r dist/* $READTHEDOCS_OUTPUT/html/

docs/environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: jupyterlab-hybrid-kernels
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- pip
6+
- python=3.11
7+
- ipywidgets>=8.1,<9
8+
- jupyterlab>=4.5.0,<5
9+
- nodejs=22
10+
- jupyterlite-core>=0.7.0,<0.8

0 commit comments

Comments
 (0)