Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# .github/workflows/preview.yml
name: Deploy PR previews

on: workflow_dispatch
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

# pull_request:
# types:
# - opened
# - reopened
# - synchronize
# - closed
permissions:
contents: write

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.12.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.12.8

Expand All @@ -30,11 +32,15 @@ jobs:
pip install sphinx-tags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also update this to use pip install -r requirements.txt so it matches the workflow on the readme (and would make the preview robust to changes in the requirements)


- name: Build the book
if: github.event.action != 'closed'
run: |
rm -rf DISCOVER/_tags/*
jupyter-book build DISCOVER

- name: Deploy PR Preview
uses: rossjrw/pr-preview-action@v1.2.0
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./DISCOVER/_build/html/
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
Loading