1010 - ' .github/workflows/sycl-docs.yml'
1111 - ' clang/docs/**'
1212 - ' sycl/doc/**'
13+ push :
14+ branches :
15+ - sycl
16+ paths :
17+ - ' .github/workflows/sycl-docs.yml'
18+ - ' clang/docs/**'
19+ - ' sycl/doc/**'
1320
14- permissions : read-all
21+ permissions :
22+ contents : read
23+ pages : write
24+ id-token : write
1525
1626jobs :
1727 build :
18- permissions :
19- contents : write # for Git to git push
2028 runs-on : ubuntu-latest
2129 if : github.repository == 'intel/llvm'
2230 steps :
@@ -35,24 +43,18 @@ jobs:
3543 -s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs
3644 cmake --build . --target docs-sycl-html
3745 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/
5152 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