File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,21 +2,21 @@ name: Build & Deploy MkDocs (gh-pages with PR previews)
22
33on :
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
1111permissions :
1212 contents : write
1313 pages : write
1414
1515jobs :
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 &&
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"
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')
You can’t perform that action at this time.
0 commit comments