|
| 1 | +# Workflow for building and deploying a Jekyll site to GitHub Pages for docs and rfcs |
| 2 | +name: Deploy Jekyll with GitHub Pages dependencies preinstalled |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - '.github/workflows/publish_docs.yml' |
| 8 | + schedule: |
| 9 | + # Run Mon at 6pm |
| 10 | + - cron: '0 18 * * 1' |
| 11 | + |
| 12 | + |
| 13 | + # Allows you to run this workflow manually from the Actions tab |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + pages: write |
| 20 | + id-token: write |
| 21 | + |
| 22 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 23 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 24 | +concurrency: |
| 25 | + group: "pages" |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + |
| 30 | + build_ock_docs: |
| 31 | + if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name == 'workflow_dispatch' |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - uses: actions/setup-python@v5 |
| 38 | + with: |
| 39 | + python-version: 3.9 |
| 40 | + |
| 41 | + - name: Install apt package |
| 42 | + run: | |
| 43 | + sudo apt-get update |
| 44 | + sudo apt-get install -y doxygen virtualenv |
| 45 | +
|
| 46 | + - name: Install prerequisites |
| 47 | + run: python -m pip install -r doc/requirements.txt |
| 48 | + |
| 49 | + - name: Build Documentation |
| 50 | + working-directory: ${{github.workspace}} |
| 51 | + run: | |
| 52 | + cmake -DCMAKE_BUILD_TYPE=Debug -DCA_RUNTIME_COMPILER_ENABLED=OFF -DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=OFF -DOCL_EXTENSION_cl_khr_il_program=OFF -Bbuild_doc |
| 53 | + cmake --build build_doc --target doc_html |
| 54 | + mkdir docs |
| 55 | + mv build_doc/doc/html docs/ock |
| 56 | +
|
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + ref: rfcs |
| 61 | + path: rfcs |
| 62 | + |
| 63 | + - name: Move rfcs to build_doc |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + mv rfcs/* docs |
| 67 | + cp -r $GITHUB_WORKSPACE/.github/workflows/combined_docs/* docs |
| 68 | +
|
| 69 | + # TODO : Remove from original rfc docs |
| 70 | + sed -i 's/permalink: index/permalink: rfc-0000/' docs/rfc-0000.md |
| 71 | + sed -i 's/split.size == 2 %/split.size == 2 and page.rfc %/' docs/rfc-0000.md |
| 72 | +
|
| 73 | + - name: Setup Pages |
| 74 | + uses: actions/configure-pages@v5 |
| 75 | + - name: Build with Jekyll |
| 76 | + uses: actions/jekyll-build-pages@v1 |
| 77 | + with: |
| 78 | + source: ./docs |
| 79 | + destination: ./_site |
| 80 | + - name: Upload artifact |
| 81 | + uses: actions/upload-pages-artifact@v3 |
| 82 | + |
| 83 | + # Deployment job |
| 84 | + deploy: |
| 85 | + environment: |
| 86 | + name: github-pages |
| 87 | + url: ${{ steps.deployment.outputs.page_url }} |
| 88 | + runs-on: ubuntu-latest |
| 89 | + needs: [ build_ock_docs ] |
| 90 | + steps: |
| 91 | + - name: Deploy to GitHub Pages |
| 92 | + id: deployment |
| 93 | + uses: actions/deploy-pages@v4 |
0 commit comments