File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 3
3
push :
4
4
branches :
5
5
- master
6
+ pull_request :
7
+
6
8
7
9
jobs :
8
10
build-and-deploy :
69
71
git clean -dfx
70
72
cd ..
71
73
- name : Publish docs
74
+ if : ${{ github.ref == 'refs/heads/master' }}
72
75
shell : bash -l {0}
73
76
run : |
74
77
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
80
83
mv ~/docs/* .
81
84
git add .
82
85
git config --global user.name 'github-actions[doc-deploy-bot]'
83
- git config --gloabl user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
86
+ git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
84
87
git commit -m "Latest docs."
85
88
git push tokened_docs gh-pages
89
+ - name : Publish pull-request docs
90
+ if : ${{ github.ref != 'refs/heads/master' }}
91
+ env :
92
+ PR_NUM : ${{ github.event.number }}
93
+ shell : bash -l {0}
94
+ run : |
95
+ git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
96
+ git fetch tokened_docs
97
+ git checkout --track tokened_docs/gh-pages
98
+ echo `pwd`
99
+ mkdir -p pulls/${PR_NUM}
100
+ cd pulls/${PR_NUM}
101
+ git rm -rf *
102
+ mv ~/docs/* .
103
+ git add .
104
+ git config --global user.name 'github-actions[doc-deploy-bot]'
105
+ git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
106
+ git commit -m "Docs for pull request ${PR_NUM}"
107
+ git push tokened_docs gh-pages
108
+ - name : Comment with URL to pull-request docs
109
+ if : ${{ github.ref != 'refs/heads/master' }}
110
+ env :
111
+ PR_NUM : ${{ github.event.number }}
112
+ uses : mshick/add-pr-comment@v1
113
+ with :
114
+ message : |
115
+ View rendered docs @ https://intelpython.github.io/dpctl/pulls/${PR_NUM}/index.html
You can’t perform that action at this time.
0 commit comments