# © Crown-owned copyright 2024, Defence Science and Technology Laboratory UK #!/bin/bash set -x apt-get update apt-get -y install git rsync python3-sphinx pwd ls -lah export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ############## # BUILD DOCS # ############## cd docs # Python Sphinx, configured with source/conf.py # See https://www.sphinx-doc.org/ make clean make html cd .. ####################### # Update GitHub Pages # ####################### git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" docroot=`mktemp -d` rsync -av $PWD/docs/_build/html/ "${docroot}/" pushd "${docroot}" git init git remote add deploy "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" git checkout -b sphinx-docs-github-pages # Adds .nojekyll file to the root to signal to GitHub that # directories that start with an underscore (_) can remain touch .nojekyll # Add README cat > README.md <