From 904c2a9ba7ff95b7ad6cb49796bd22c0c8ff02e8 Mon Sep 17 00:00:00 2001 From: Udit Agarwal Date: Thu, 26 Sep 2024 10:23:28 -0700 Subject: [PATCH] [CI] Migrate intel.github.io/llvm-docs/ to `intel/llvm` (#15483) Follow up of https://github.com/intel/llvm/pull/15482 This PR enables hosting [intel.github.io/llvm-docs/ ](intel.github.io/llvm-docs/) website from intel/llvm. Generated docs will be uploaded as an artifact and will be used to host GH page (https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow). The new URL of the website will be **intel.github.io/llvm/** Example: https://uditagarwal97.github.io/llvm/ --- .github/workflows/sycl-docs.yml | 48 +++++++++++++++++---------------- README.md | 2 +- devops/scripts/sycl-bisect.bash | 2 +- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/sycl-docs.yml b/.github/workflows/sycl-docs.yml index b50b0e897e158..5c1e8e425111b 100644 --- a/.github/workflows/sycl-docs.yml +++ b/.github/workflows/sycl-docs.yml @@ -10,13 +10,21 @@ on: - '.github/workflows/sycl-docs.yml' - 'clang/docs/**' - 'sycl/doc/**' + push: + branches: + - sycl + paths: + - '.github/workflows/sycl-docs.yml' + - 'clang/docs/**' + - 'sycl/doc/**' -permissions: read-all +permissions: + contents: read + pages: write + id-token: write jobs: build: - permissions: - contents: write # for Git to git push runs-on: ubuntu-latest if: github.repository == 'intel/llvm' steps: @@ -35,24 +43,18 @@ jobs: -s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs cmake --build . --target docs-sycl-html cmake --build . --target docs-clang-html - - name: Deploy - if: ${{ github.event_name == 'schedule' }} - env: - SSH_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}} - run: | - mkdir -p ~/.ssh - echo "$SSH_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - eval "$(ssh-agent -s)" - ssh-add -k ~/.ssh/id_rsa - git clone git@github.com:intel/llvm-docs.git docs - cd $GITHUB_WORKSPACE/docs - git rm -rf . + # Copy the generated docs to a separate directory for uploading. + mkdir $GITHUB_WORKSPACE/install_docs + cd $GITHUB_WORKSPACE/install_docs + mkdir clang + mv $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* . + mv $GITHUB_WORKSPACE/build/tools/clang/docs/html/* clang/ touch .nojekyll - yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* . - mv $GITHUB_WORKSPACE/build/tools/clang/docs/html clang/ - git config --global user.name "iclsrc" - git config --global user.email "ia.compiler.tools.git@intel.com" - git add . - git diff-index --quiet HEAD || git commit --amend -m "Update docs" -s - git push -f + # Upload the generated docs as an artifact and deploy to GitHub Pages. + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./install_docs + - name: Deploy to GitHub Pages + if: ${{ github.event_name == 'push' }} + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 8ab5cda1621bb..a60f1e7c96ad6 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ source project. One of the examples is Features parity between this project and downstream projects is not guaranteed. Project documentation is available at: -[DPC++ Documentation](https://intel.github.io/llvm-docs/). +[DPC++ Documentation](https://intel.github.io/llvm/). ### How to use DPC++ diff --git a/devops/scripts/sycl-bisect.bash b/devops/scripts/sycl-bisect.bash index a2fb4d9cc49d0..c3d20b1019484 100755 --- a/devops/scripts/sycl-bisect.bash +++ b/devops/scripts/sycl-bisect.bash @@ -118,7 +118,7 @@ done if [[ ! -f build/CMakeCache.txt ]]; then echo "The build directory doesn't seem to be configured yet." >&2 echo "Please run the configure step as documented in sycl/doc/GetStartedGuide.md:" >&2 - echo " https://intel.github.io/llvm-docs/GetStartedGuide.html#build-dpc-toolchain" >&2 + echo " https://intel.github.io/llvm/GetStartedGuide.html#build-dpc-toolchain" >&2 exit 1 fi