Skip to content

Commit

Permalink
[CI] make docs workflow reusable in deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszstolarczuk committed Dec 23, 2024
1 parent 78d2798 commit c7fdc11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 38 deletions.
43 changes: 6 additions & 37 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,14 @@ permissions:
contents: read

jobs:
build:
name: Build docs
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen
# Latest distros do not allow global pip installation
- name: Install Python requirements in venv
run: |
python3 -m venv .venv
. .venv/bin/activate
echo "$PATH" >> $GITHUB_PATH
python3 -m pip install -r third_party/requirements.txt
- name: Setup PATH for python
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Build the documentation
run: |
cmake -B build -DUMF_TESTS_FAIL_ON_SKIP=ON
cmake --build build --target docs
- name: Upload artifact
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
path: build/docs_build/generated/html
DocsBuild:
uses: ./.github/workflows/reusable_docs_build.yml
with:
upload: true

deploy:
DocsDeploy:
name: Deploy docs to GitHub Pages
needs: build
needs: DocsBuild

permissions:
pages: write
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/reusable_docs_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Docs build

on: workflow_call
on:
workflow_call:
inputs:
upload:
description: Should HTML documentation be uploaded as artifact?
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -38,3 +44,9 @@ jobs:
-DUMF_BUILD_EXAMPLES=OFF \
-DUMF_DISABLE_HWLOC=ON
cmake --build build --target docs
- name: Upload artifact
if: ${{ inputs.upload == true }}
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
path: build/docs_build/generated/html

0 comments on commit c7fdc11

Please sign in to comment.