Skip to content

Commit 4e062ec

Browse files
authoredJun 17, 2024··
Merge pull request #112 from linkml/issue-2029
GitHub Action workflow to preview documentation changes in PRs
2 parents c818519 + a0dc222 commit 4e062ec

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed
 

‎{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
2222

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Preview {{cookiecutter.__project_slug}} documentation build
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
concurrency: preview-${{ github.ref }}
11+
12+
jobs:
13+
run:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python 3
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.9
25+
26+
- name: Install Poetry
27+
run: pipx install poetry
28+
29+
- name: Install dependencies
30+
run: poetry install -E docs
31+
32+
- name: Build documentation
33+
run: |
34+
mkdir -p site
35+
touch site/.nojekyll
36+
make gendoc
37+
([ ! -f docs/about.md ] && cp src/docs/about.md docs/) || true
38+
poetry run mkdocs build -d site
39+
40+
- name: Deploy preview
41+
uses: rossjrw/pr-preview-action@v1
42+
with:
43+
source-dir: site/
44+
preview-branch: gh-pages

0 commit comments

Comments
 (0)
Please sign in to comment.