File size: 1,268 Bytes
31dc8dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/bin/bash
set -e
# Build documentation script for Diffulex
# This script can be used both locally and in CI environments
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$PROJECT_ROOT"
# Check if we're in a CI environment (GitHub Actions provides this)
if [ -z "${CI}" ] && [ -z "${GITHUB_ACTIONS}" ]; then
# Local development: create and use virtual environment
if [ ! -d ".venv" ]; then
python -m venv .venv
fi
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt --force-reinstall
else
# CI environment: just install dependencies (Python environment already set up)
pip install --upgrade pip
pip install -r docs/requirements.txt --force-reinstall
fi
# Build documentation
cd docs
make html
# Create .nojekyll file to disable Jekyll processing on GitHub Pages
touch _build/html/.nojekyll
echo ".nojekyll file created to disable Jekyll"
# Copy CNAME file if it exists (for GitHub Pages custom domain)
if [ -f "CNAME" ]; then
cp CNAME _build/html/
echo "CNAME file copied to build output"
fi
echo "Documentation build completed successfully!"
|