-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (38 loc) · 1.13 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Build pull requests and deploy.
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install Material for MkDocs
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build the book
run: |
mkdocs build
# NOTE: we can only deploy PR previews from the original repository.
# This action fails when the PR originates from a forked repository;
# see https://github.com/rossjrw/pr-preview-action/issues/3 for details.
- name: Deploy preview
if: github.event.pull_request.head.repo.full_name == github.repository
uses: rossjrw/pr-preview-action@v1
with:
source-dir: site
force: false
clean-exclude: pr-preview/