Skip to content

Deploy to Netlify

This guide explains how to deploy the MkDocs site in this repository to Netlify.

Prerequisites

  • A Netlify account
  • This repository pushed to a Git host Netlify can access (GitHub, GitLab, or Bitbucket)
  1. Push your latest changes to the main branch of your Git repository.
  2. In Netlify, select "Add new site" -> "Import an existing project".
  3. Choose your Git provider and pick the cellrepo-user-manual repo.
  4. Set the build options:
  5. Build command: pip install -r requirements.txt && mkdocs build
  6. Publish directory: site
  7. Add an environment variable for Python:
  8. PYTHON_VERSION = 3.11 (or another supported version)
  9. Click "Deploy site".

Netlify will build the site and publish the contents of site/.

Add a requirements.txt (if you do not already have one)

Netlify does not install Python packages automatically. Add a requirements.txt file in the repository root with:

mkdocs
mkdocs-material

If you add MkDocs plugins later, include them here so Netlify installs them during the build.

You can store the build settings in a netlify.toml file so they are versioned with the repo:

[build]
  command = "pip install -r requirements.txt && mkdocs build"
  publish = "site"

[build.environment]
  PYTHON_VERSION = "3.11"

Troubleshooting

  • Build fails with "mkdocs: command not found": confirm the build command installs dependencies.
  • Missing pages or assets: check that paths in mkdocs.yml and docs/ match and that the publish directory is site.