Skip to content

Commit 067b184

Browse files
authored
Add ReadTheDocs build config for PR previews (#9)
* Add RTD build config * Add RTD link to PR descriptions
1 parent 02560b4 commit 067b184

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/pr-rtd-link.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The ReadTheDocs preview link is "hidden" within the GitHub "Checks"
2+
# interface. For users who don't know this, finding the preview link may be
3+
# very difficult or frustrating. This workflow makes the link more
4+
# findable by updating PR descriptions to include it.
5+
name: 'Add ReadTheDocs preview link to PR description'
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- 'opened'
11+
12+
permissions:
13+
pull-requests: 'write'
14+
15+
jobs:
16+
autolink-rtd-previews:
17+
runs-on: 'ubuntu-latest'
18+
steps:
19+
- uses: 'readthedocs/actions/preview@v1'
20+
with:
21+
project-slug: 'jupytergis'
22+
message-template: |
23+
:mag: Preview: {docs-pr-index-url}
24+
This Pull Request preview is provided by ReadTheDocs. Our production website, however, is currently deployed with GitHub Pages.

.readthedocs.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# For this project, we use ReadTheDocs only for Pull Request previews. GitHub
2+
# pages currently hosts the actual website.
3+
version: 2
4+
5+
6+
build:
7+
os: "ubuntu-lts-latest"
8+
9+
commands:
10+
# Download: https://quarto.org/docs/download/tarball.html
11+
- "wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.6.40/quarto-1.6.40-linux-amd64.tar.gz"
12+
13+
# Install
14+
- "mkdir --parents ~/opt/quarto ~/bin"
15+
- "tar -C ~/opt/quarto -xvzf quarto*.tar.gz --strip-components 1"
16+
- "ln -s ~/opt/quarto/bin/quarto ~/bin/quarto"
17+
18+
# Render
19+
- "cd doc && ~/bin/quarto render"
20+
- "mkdir --parents $READTHEDOCS_OUTPUT/html/"
21+
- "mv doc/_site/* $READTHEDOCS_OUTPUT/html/."

0 commit comments

Comments
 (0)