Skip to content

Commit c7fdc11

Browse files
[CI] make docs workflow reusable in deploy job
1 parent 78d2798 commit c7fdc11

File tree

2 files changed

+19
-38
lines changed

2 files changed

+19
-38
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,14 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
build:
18-
name: Build docs
19-
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
20-
21-
steps:
22-
- name: Checkout repository
23-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24-
with:
25-
fetch-depth: 0
26-
27-
- name: Install doxygen
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get install -y doxygen
31-
32-
# Latest distros do not allow global pip installation
33-
- name: Install Python requirements in venv
34-
run: |
35-
python3 -m venv .venv
36-
. .venv/bin/activate
37-
echo "$PATH" >> $GITHUB_PATH
38-
python3 -m pip install -r third_party/requirements.txt
39-
40-
- name: Setup PATH for python
41-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
42-
43-
- name: Build the documentation
44-
run: |
45-
cmake -B build -DUMF_TESTS_FAIL_ON_SKIP=ON
46-
cmake --build build --target docs
47-
48-
- name: Upload artifact
49-
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
50-
with:
51-
path: build/docs_build/generated/html
17+
DocsBuild:
18+
uses: ./.github/workflows/reusable_docs_build.yml
19+
with:
20+
upload: true
5221

53-
deploy:
22+
DocsDeploy:
5423
name: Deploy docs to GitHub Pages
55-
needs: build
24+
needs: DocsBuild
5625

5726
permissions:
5827
pages: write

.github/workflows/reusable_docs_build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Docs build
22

3-
on: workflow_call
3+
on:
4+
workflow_call:
5+
inputs:
6+
upload:
7+
description: Should HTML documentation be uploaded as artifact?
8+
type: boolean
9+
default: false
410

511
permissions:
612
contents: read
@@ -38,3 +44,9 @@ jobs:
3844
-DUMF_BUILD_EXAMPLES=OFF \
3945
-DUMF_DISABLE_HWLOC=ON
4046
cmake --build build --target docs
47+
48+
- name: Upload artifact
49+
if: ${{ inputs.upload == true }}
50+
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
51+
with:
52+
path: build/docs_build/generated/html

0 commit comments

Comments
 (0)