forked from linkml/linkml-project-cookiecutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request linkml#112 from linkml/issue-2029
GitHub Action workflow to preview documentation changes in PRs
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
{{cookiecutter.project_name}}/.github/workflows/test_pages_build.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Preview {{cookiecutter.__project_slug}} documentation build | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
- name: Install dependencies | ||
run: poetry install -E docs | ||
|
||
- name: Build documentation | ||
run: | | ||
mkdir -p site | ||
touch site/.nojekyll | ||
make gendoc | ||
([ ! -f docs/about.md ] && cp src/docs/about.md docs/) || true | ||
poetry run mkdocs build -d site | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: site/ | ||
preview-branch: gh-pages |