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
13 changes: 7 additions & 6 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Build & Deploy MkDocs (gh-pages with PR previews)

on:
workflow_dispatch:
release:
types: [published]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, closed]
push:
branches: [ main ]

permissions:
contents: write
pages: write

jobs:
build:
# Run for push, workflow dispatch, PRs from SAME repo that are not closed
# Run for release, workflow dispatch for manual validation (build only), PRs from SAME repo that are not closed
if: |
github.event_name == 'push' ||
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.fork == false &&
Expand All @@ -29,6 +29,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -46,9 +47,9 @@ jobs:

deploy:
needs: build
# Deploy on push to main (root) or PRs from SAME repo (not closed) -> pr-<N>/
# Deploy on release or PRs from SAME repo (not closed) -> pr-<N>/
if: |
github.event_name == 'push' ||
github.event_name == 'release' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.fork == false &&
github.event.action != 'closed')
Expand Down
Loading