Skip to content

Commit

Permalink
GitHub Action workflow to preview documentation changes in PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaypatil96 committed Jun 12, 2024
1 parent c818519 commit 6b57536
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

Expand Down
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

0 comments on commit 6b57536

Please sign in to comment.