10
10
- ' .github/workflows/sycl-docs.yml'
11
11
- ' clang/docs/**'
12
12
- ' sycl/doc/**'
13
+ push :
14
+ branches :
15
+ - sycl
16
+ paths :
17
+ - ' .github/workflows/sycl-docs.yml'
18
+ - ' clang/docs/**'
19
+ - ' sycl/doc/**'
13
20
14
- permissions : read-all
21
+ permissions :
22
+ contents : read
23
+ pages : write
24
+ id-token : write
15
25
16
26
jobs :
17
27
build :
18
- permissions :
19
- contents : write # for Git to git push
20
28
runs-on : ubuntu-latest
21
29
if : github.repository == 'intel/llvm'
22
30
steps :
@@ -35,24 +43,18 @@ jobs:
35
43
-s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs
36
44
cmake --build . --target docs-sycl-html
37
45
cmake --build . --target docs-clang-html
38
- - name : Deploy
39
- if : ${{ github.event_name == 'schedule' }}
40
- env :
41
- SSH_KEY : ${{secrets.ACTIONS_DEPLOY_KEY}}
42
- run : |
43
- mkdir -p ~/.ssh
44
- echo "$SSH_KEY" > ~/.ssh/id_rsa
45
- chmod 600 ~/.ssh/id_rsa
46
- eval "$(ssh-agent -s)"
47
- ssh-add -k ~/.ssh/id_rsa
48
- git clone [email protected] :intel/llvm-docs.git docs
49
- cd $GITHUB_WORKSPACE/docs
50
- git rm -rf .
46
+ # Copy the generated docs to a separate directory for uploading.
47
+ mkdir $GITHUB_WORKSPACE/install_docs
48
+ cd $GITHUB_WORKSPACE/install_docs
49
+ mkdir clang
50
+ mv $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
51
+ mv $GITHUB_WORKSPACE/build/tools/clang/docs/html/* clang/
51
52
touch .nojekyll
52
- yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
53
- mv $GITHUB_WORKSPACE/build/tools/clang/docs/html clang/
54
- git config --global user.name "iclsrc"
55
- git config --global user.email "[email protected] "
56
- git add .
57
- git diff-index --quiet HEAD || git commit --amend -m "Update docs" -s
58
- git push -f
53
+ # Upload the generated docs as an artifact and deploy to GitHub Pages.
54
+ - name : Upload artifact
55
+ uses : actions/upload-pages-artifact@v3
56
+ with :
57
+ path : ./install_docs
58
+ - name : Deploy to GitHub Pages
59
+ if : ${{ github.event_name == 'push' }}
60
+ uses : actions/deploy-pages@v4
0 commit comments