Skip to content

Commit

Permalink
add docs ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alinelena committed Feb 2, 2024
1 parent 68fcea5 commit a0b5340
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
pip install --upgrade pip
pip install -r requirements.txt
# Change plugin_name to test we're not specific to "aiida-diff"
cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
pip install -e ${PLUGIN_NAME}[testing]
#cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
#pip install -e ${PLUGIN_NAME}[testing]
env:
PLUGIN_NAME: aiida-mlip

Expand Down Expand Up @@ -73,8 +73,8 @@ jobs:
pip install --upgrade pip
pip install -r requirements.txt
# Change plugin_name to test we're not specific to "aiida-diff"
cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
pip install -e ${PLUGIN_NAME}[docs]
#cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
#pip install -e ${PLUGIN_NAME}[docs]
- name: Build docs
env:
PLUGIN_NAME: aiida-mlip
Expand All @@ -96,8 +96,8 @@ jobs:
pip install --upgrade pip
pip install -r requirements.txt
# Change plugin_name to test we're not specific to "aiida-diff"
cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
pip install -e ${PLUGIN_NAME}[pre-commit,docs,testing]
#cookiecutter --no-input . plugin_name=${PLUGIN_NAME}
#pip install -e ${PLUGIN_NAME}[pre-commit,docs,testing]
- name: Run pre-commit
env:
PLUGIN_NAME: aiida-mlip
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: aiida-mlip documentation publish

on:
push:
branches: [main]
pull_request:
branches: [main]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
docs-deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container: sphinxdoc/sphinx

steps:
- uses: actions/checkout@v3
- name: sphinx
run: |
pip install sphinxcontrib-contentui furo aiida-core
# temp fix install the package
python -m pip install .
cd docs
make html
- name: upload
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './docs/build/html/.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
17 changes: 12 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import time


from aiida import load_profile
from aiida.storage.sqlite_temp import SqliteTempBackend

Expand Down Expand Up @@ -81,6 +82,7 @@
#
# The full version, including alpha/beta/rc tags.
release = aiida_mlip.__version__

# The short X.Y version.
version = ".".join(release.split(".")[:2])

Expand Down Expand Up @@ -114,7 +116,12 @@
html_theme = "furo"
html_logo = "images/AiiDA_transparent_logo.png"
html_title = f"aiida-mlip v{release}"
html_theme_options = {}
html_theme_options = {
"source_repository": "https://github.com/stfc/aiida-mlip/",
"source_branch": "main",
"source_directory": "docs/",
}


# Add any paths that contain custom themes here, relative to this directory.
# ~ html_theme_path = ["."]
Expand All @@ -136,14 +143,14 @@

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand All @@ -162,15 +169,15 @@
html_show_sourcelink = False

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# ~ html_show_copyright = False

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
html_use_opensearch = "https://aiida-mlip.readthedocs.io"
html_use_opensearch = "https://stfc.github.io/aiida-mlip/"

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cookiecutter
#keep it empty

0 comments on commit a0b5340

Please sign in to comment.