Skip to content

Commit 6c24335

Browse files
authored
Update docs publication workflow for releases
1 parent b61e86c commit 6c24335

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎.github/workflows/deploy-docs.yaml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ name: Build & Deploy MkDocs (gh-pages with PR previews)
22

33
on:
44
workflow_dispatch:
5+
release:
6+
types: [published]
57
pull_request:
68
branches: [ main ]
79
types: [opened, synchronize, reopened, closed]
8-
push:
9-
branches: [ main ]
1010

1111
permissions:
1212
contents: write
1313
pages: write
1414

1515
jobs:
1616
build:
17-
# Run for push, workflow dispatch, PRs from SAME repo that are not closed
17+
# Run for release, workflow dispatch for manual validation (build only), PRs from SAME repo that are not closed
1818
if: |
19-
github.event_name == 'push' ||
19+
github.event_name == 'release' ||
2020
github.event_name == 'workflow_dispatch' ||
2121
(github.event_name == 'pull_request' &&
2222
github.event.pull_request.head.repo.fork == false &&
@@ -29,6 +29,7 @@ jobs:
2929
- uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
32+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
3233
- uses: actions/setup-python@v5
3334
with:
3435
python-version: "3.11"
@@ -46,9 +47,9 @@ jobs:
4647

4748
deploy:
4849
needs: build
49-
# Deploy on push to main (root) or PRs from SAME repo (not closed) -> pr-<N>/
50+
# Deploy on release or PRs from SAME repo (not closed) -> pr-<N>/
5051
if: |
51-
github.event_name == 'push' ||
52+
github.event_name == 'release' ||
5253
(github.event_name == 'pull_request' &&
5354
github.event.pull_request.head.repo.fork == false &&
5455
github.event.action != 'closed')

0 commit comments

Comments
 (0)