Skip to content

Commit 90bc218

Browse files
github actions workflow for publishing documentation (uxlfoundation#494)
Co-authored-by: Dai-Ni Hsieh <dai-ni.hsieh@intel.com>
1 parent 7c3eec6 commit 90bc218

File tree

4 files changed

+108
-213
lines changed

4 files changed

+108
-213
lines changed

.github/workflows/documentation.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Documentation
2+
permissions: read-all
3+
4+
# Trigger for PR or merge to develop branch
5+
on:
6+
push:
7+
branches: develop
8+
paths:
9+
- 'docs/**'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
20+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
21+
with:
22+
python-version: '3.11'
23+
cache: 'pip'
24+
- name: Install Dependencies
25+
run: pip install -r docs/requirements.txt
26+
- name: Configure & Build
27+
run: |
28+
cmake -DCMAKE_VERBOSE_MAKEFILE=on -B build docs
29+
cmake --build build
30+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
31+
with:
32+
name: docs
33+
path: build/Documentation/html
34+
35+
publish:
36+
needs: build
37+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/develop'
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: write
41+
steps:
42+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
43+
with:
44+
ref: gh-pages
45+
path: gh-pages
46+
- name: Remove old site
47+
run: rm -rf gh-pages/*
48+
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
49+
with:
50+
name: docs
51+
path: gh-pages
52+
- name: Push to GitHub Pages
53+
run: |
54+
cd gh-pages
55+
touch .nojekyll
56+
git add .
57+
git config --global user.name "GitHub Actions"
58+
git config --global user.email github-actions@github.com
59+
git commit -m "Update documentation"
60+
git push --force origin gh-pages

docs/conf.py

-201
This file was deleted.

docs/conf.py.in

+20-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# If extensions (or modules to document with autodoc) are in another directory,
1212
# add these directories to sys.path here. If the directory is relative to the
13-
# documentation root, use os.path.abspath to make it absolute, like shown here.
13+
# documentation root, use os.path.abspath to make it absolute, as shown here.
1414
#
1515
# import os
1616
# import sys
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'oneAPI Math Kernel Library Interfaces'
23-
copyright = '2020, Intel Corporation'
23+
copyright = '2020-2022, Intel Corporation'
2424
author = 'Intel Corporation'
2525

2626
# The short X.Y version
@@ -41,7 +41,6 @@ release = '0.1'
4141
extensions = [
4242
'sphinx.ext.autodoc',
4343
'sphinx.ext.doctest',
44-
'sphinx.ext.intersphinx',
4544
'sphinx.ext.todo',
4645
]
4746

@@ -62,7 +61,7 @@ master_doc = 'index'
6261
#
6362
# This is also used if you do content translation via gettext catalogs.
6463
# Usually you set "language" from the command line for these cases.
65-
language = None
64+
language = 'en'
6665

6766
# List of patterns, relative to source directory, that match files and
6867
# directories to ignore when looking for source files.
@@ -72,24 +71,38 @@ exclude_patterns = []
7271
# The name of the Pygments (syntax highlighting) style to use.
7372
pygments_style = None
7473

74+
static_dir = '@CMAKE_CURRENT_SOURCE_DIR@/_static'
75+
7576

7677
# -- Options for HTML output -------------------------------------------------
7778

7879
# The theme to use for HTML and HTML Help pages. See the documentation for
7980
# a list of builtin themes.
8081
#
81-
html_theme = 'alabaster'
82+
html_theme = 'sphinx_book_theme'
83+
html_logo = f'{static_dir}/oneAPI-rgb-rev-100.png'
84+
html_favicon = f'{static_dir}/favicons.png'
8285

8386
# Theme options are theme-specific and customize the look and feel of a theme
8487
# further. For a list of options available for each theme, see the
8588
# documentation.
8689
#
87-
# html_theme_options = {}
90+
91+
# Theme options
92+
html_theme_options = {
93+
'repository_url': 'https://github.com/oneapi-src/oneMKL',
94+
'path_to_docs': 'docs',
95+
'use_issues_button': True,
96+
'use_edit_page_button': True,
97+
'repository_branch': 'develop',
98+
'extra_footer': '<p align="right"><a href="https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html">Cookies</a></p>',
99+
'navigation_with_keys': False,
100+
}
88101

89102
# Add any paths that contain custom static files (such as style sheets) here,
90103
# relative to this directory. They are copied after the builtin static files,
91104
# so a file named "default.css" will overwrite the builtin "default.css".
92-
html_static_path = ['_static']
105+
html_static_path = [static_dir]
93106

94107
# Custom sidebar templates, must be a dictionary that maps document names
95108
# to template names.
@@ -179,11 +192,6 @@ epub_exclude_files = ['search.html']
179192

180193
# -- Extension configuration -------------------------------------------------
181194

182-
# -- Options for intersphinx extension ---------------------------------------
183-
184-
# Example configuration for intersphinx: refer to the Python standard library.
185-
intersphinx_mapping = {'https://docs.python.org/': None}
186-
187195
# -- Options for todo extension ----------------------------------------------
188196

189197
# If true, `todo` and `todoList` produce output, else they produce nothing.

docs/requirements.txt

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
accessible-pygments==0.0.5
2+
alabaster==0.7.16
3+
Babel==2.15.0
4+
beautifulsoup4==4.12.3
5+
certifi==2024.2.2
6+
charset-normalizer==3.3.2
7+
docutils==0.21.2
8+
idna==3.7
9+
imagesize==1.4.1
10+
Jinja2==3.1.4
11+
MarkupSafe==2.1.5
12+
packaging==24.0
13+
pydata-sphinx-theme==0.15.2
14+
Pygments==2.18.0
15+
requests==2.32.1
16+
snowballstemmer==2.2.0
17+
soupsieve==2.5
18+
Sphinx==7.3.7
19+
sphinx-book-theme==1.1.2
20+
sphinxcontrib-applehelp==1.0.8
21+
sphinxcontrib-devhelp==1.0.6
22+
sphinxcontrib-htmlhelp==2.0.5
23+
sphinxcontrib-jsmath==1.0.1
24+
sphinxcontrib-qthelp==1.0.7
25+
sphinxcontrib-serializinghtml==1.1.10
26+
tomli==2.0.1
27+
typing_extensions==4.11.0
28+
urllib3==2.2.1

0 commit comments

Comments
 (0)