7676 mv ../cmake-install/docs/docs ~/docs
7777 git clean -dfx
7878 - name : Publish docs
79- if : ${{ github.ref == 'refs/heads/master' }}
79+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github. ref == 'refs/heads/master' }}
8080 shell : bash -l {0}
8181 run : |
8282 git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
9191 git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
9292 git commit -m "Latest docs."
9393 git push tokened_docs gh-pages
94+ - name : Save built docs as an artifact
95+ if : ${{ github.event.pull_request && github.event.pull_request.head.repo.fork && github.event.action != 'closed'}}
96+ uses : actions/upload-artifact@v3
97+ with :
98+ name : ${{ env.PACKAGE_NAME }} rendered documentation
99+ path : ~/docs
100+
94101 - name : Publish pull-request docs
95- if : ${{ github.event.pull_request && github.event.action != 'closed' }}
102+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' }}
96103 env :
97104 PR_NUM : ${{ github.event.number }}
98105 shell : bash -l {0}
@@ -111,7 +118,7 @@ jobs:
111118 git commit -m "Docs for pull request ${PR_NUM}"
112119 git push tokened_docs gh-pages
113120 - name : Unpublish pull-request docs
114- if : ${{ github.event.pull_request && github.event.action == 'closed' }}
121+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed' }}
115122 env :
116123 PR_NUM : ${{ github.event.number }}
117124 shell : bash -l {0}
@@ -128,7 +135,7 @@ jobs:
128135 git commit -m "Removing docs for closed pull request ${PR_NUM}"
129136 git push tokened_docs gh-pages
130137 - name : Comment with URL to published pull-request docs
131- if : ${{ github.event.pull_request && github.event.action != 'closed' }}
138+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' }}
132139 env :
133140 PR_NUM : ${{ github.event.number }}
134141 uses : mshick/add-pr-comment@v1
@@ -138,7 +145,7 @@ jobs:
138145 repo-token : ${{ secrets.GITHUB_TOKEN }}
139146 repo-token-user-login : ' github-actions[bot]'
140147 - name : Comment with URL about removal of PR docs
141- if : ${{ github.event.pull_request && github.event.action == 'closed' }}
148+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed' }}
142149 env :
143150 PR_NUM : ${{ github.event.number }}
144151 uses : mshick/add-pr-comment@v1
0 commit comments