@@ -2,8 +2,10 @@ name: doc-deploy-PR
2
2
3
3
on :
4
4
workflow_run :
5
- workflows : [docs ]
5
+ workflows : [ci ]
6
6
types : [completed]
7
+ pull_request :
8
+ types : [closed]
7
9
8
10
env :
9
11
DOCUMENTATION_CNAME : ' dpf.docs.pyansys.com'
@@ -20,27 +22,48 @@ jobs:
20
22
name : " Deploy PR documentation"
21
23
runs-on : ubuntu-latest
22
24
if : |
23
- github.event.workflow_run.conclusion == 'success' &&
24
- contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
25
+ (
26
+ github.event_name == 'workflow_run' &&
27
+ github.event.workflow_run.conclusion == 'success' &&
28
+ contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
29
+ ) || (
30
+ github.event_name == 'pull_request' &&
31
+ github.event.action == 'closed' &&
32
+ contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
33
+ )
25
34
steps :
26
- - name : " Download artifacts"
35
+ - name : Set PR number
36
+ id : pr
37
+ run : |
38
+ if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
39
+ echo "pr_number=${{ fromJson(toJson(github.event.workflow_run.pull_requests[0])).number }}" >> "$GITHUB_OUTPUT"
40
+ else
41
+ echo "pr_number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
42
+ fi
43
+
44
+ - name : Print PR number
45
+ run : echo "PR number is ${{ steps.pr.outputs.pr_number }}"
46
+
47
+ - name : Download artifacts (if workflow_run)
48
+ if : ${{ github.event_name == 'workflow_run' }}
27
49
uses : dawidd6/action-download-artifact@v11
28
50
with :
29
51
workflow : docs.yml
30
52
name : HTML-doc-ansys-dpf-core.zip
31
53
github_token : ${{ secrets.GITHUB_TOKEN }}
32
54
run_id : ${{ github.event.workflow_run.id }}
33
55
34
-
35
- - name : " Display downloaded files "
56
+ - name : Display downloaded files (if workflow_run)
57
+ if : ${{ github.event_name == 'workflow_run' }}
36
58
run : ls -R
37
59
38
- - uses : ansys/actions/doc-deploy-pr@v10
60
+ - name : Deploy PR documentation
61
+ uses : ansys/actions/doc-deploy-pr@v10
39
62
with :
40
63
cname : ${{ env.DOCUMENTATION_CNAME }}
41
64
token : ${{ secrets.GITHUB_TOKEN }}
42
65
doc-artifact-name : HTML-doc-ansys-dpf-core.zip
43
66
decompress-artifact : true
44
67
bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
45
68
bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
46
- maximum-pr-doc-deployments : 10
69
+ maximum-pr-doc-deployments : 10
0 commit comments