Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions workflow for publishing documentation #494

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Documentation
permissions: read-all

# Trigger for PR or merge to develop branch
on:
push:
branches: develop
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'
cache: 'pip'
- name: Install Dependencies
run: pip install -r docs/requirements.txt
- name: Configure & Build
run: |
cmake -DCMAKE_VERBOSE_MAKEFILE=on -B build docs
cmake --build build
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: docs
path: build/Documentation/html

publish:
needs: build
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: gh-pages
path: gh-pages
- name: Remove old site
run: rm -rf gh-pages/*
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs
path: gh-pages
- name: Push to GitHub Pages
run: |
cd gh-pages
touch .nojekyll
git add .
git config --global user.name "GitHub Actions"
git config --global user.email github-actions@github.com
git commit -m "Update documentation"
git push --force origin gh-pages
201 changes: 0 additions & 201 deletions docs/conf.py

This file was deleted.

32 changes: 20 additions & 12 deletions docs/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

project = 'oneAPI Math Kernel Library Interfaces'
copyright = '2020, Intel Corporation'
copyright = '2020-2022, Intel Corporation'
author = 'Intel Corporation'

# The short X.Y version
Expand All @@ -41,7 +41,6 @@ release = '0.1'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
]

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

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

static_dir = '@CMAKE_CURRENT_SOURCE_DIR@/_static'


# -- Options for HTML output -------------------------------------------------

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

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Theme options
html_theme_options = {
'repository_url': 'https://github.com/oneapi-src/oneMKL',
'path_to_docs': 'docs',
'use_issues_button': True,
'use_edit_page_button': True,
'repository_branch': 'develop',
'extra_footer': '<p align="right"><a href="https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html">Cookies</a></p>',
'navigation_with_keys': False,
}

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

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

# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
Expand Down
28 changes: 28 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
accessible-pygments==0.0.5
alabaster==0.7.16
Babel==2.15.0
beautifulsoup4==4.12.3
certifi==2024.2.2
charset-normalizer==3.3.2
docutils==0.21.2
idna==3.7
imagesize==1.4.1
Jinja2==3.1.4
MarkupSafe==2.1.5
packaging==24.0
pydata-sphinx-theme==0.15.2
Pygments==2.18.0
requests==2.32.1
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.3.7
sphinx-book-theme==1.1.2
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
tomli==2.0.1
typing_extensions==4.11.0
urllib3==2.2.1