Skip to content

Fix liniting and typing issues. #87

Fix liniting and typing issues.

Fix liniting and typing issues. #87

name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
push:
branches: ["main"]
workflow_dispatch: # enable manual workflow execution
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
# prevent this action from running on forks
if: github.repository == 'materialsproject/pymatgen-core'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pymatgen with docs dependencies
run: |
pip install -e ".[docs]"
pip install sphinx sphinx-rtd-theme sphinx_markdown_builder
- name: Generate Sphinx API docs
working-directory: docs
run: |
echo ".. This file is required as the Sphinx master_doc entry point. Content is generated by sphinx-apidoc." > apidoc/index.rst
sphinx-apidoc --implicit-namespaces -M -d 7 -o apidoc -f ../src/pymatgen
sphinx-build -b html apidoc html
rm -rf .apidoc_merge
rm apidoc/*.rst
mv html/pymatgen*.html .
mv html/modules.html .
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4