Skip to content

update notebook with working example #78

update notebook with working example

update notebook with working example #78

Workflow file for this run

name: Continuous Testing and Docs Publication
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
run-linter:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8.6"]
steps:
- name: Checkout this repository
uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run pre-commit hooks
run: |
python -m pip install pre-commit
pre-commit run --all
build-and-deploy-docs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
env:
ACCOUNT_ID: ${{ secrets.DEMO_ACCOUNT_ID }}
AUTH_TOKEN: ${{ secrets.DEMO_AUTH_TOKEN }}
MATERIALS_PROJECT_API_KEY: ${{ secrets.MATERIALS_PROJECT_API_KEY }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout this repository
uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
set -euo pipefail
python -m pip install -ve ".[localhost, docs]"
python -m pip list
- name: Export requirements.txt
run: |
pip install pip-tools
for extra in colab localhost dev docs; do
python -m piptools compile --resolver=backtracking --extra ${extra} -o requirements-${extra}.txt pyproject.toml
done
- name: Build documentation
run : |
mkdocs build -d site
- uses: actions/upload-artifact@v3
with:
name: rendered-notebooks-py${{ matrix.python-version }}
path: site
- uses: actions/upload-artifact@v3
with:
name: requirements-py${{ matrix.python-version }}
path: requirements-*.txt
- name: Deploy documentation to Exabyte-io.github.io
if: github.repository_owner == 'Exabyte-io' && github.ref_name == 'dev' && matrix.python-version == '3.8'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: dev-with-documentation
publish_dir: ./site
destination_dir: ./docs
keep_files: true # Keep old files.
force_orphan: false # Keep git history.