Raw File
Tip revision: 2aa983479bb9d2006483a0e52c50e4cf55624bec authored by Jean Kossaifi on 02 January 2021, 20:46 UTC
Update Github action to build doc
Tip revision: 2aa9834
# Inspired from scikit-image
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_BRANCH == "master" &&
	      $DEPLOY_DOCS == 1 ]]
	echo "---------------------------------------------------"
	echo " building doc and pushing to website"
    git config --global ""
    git config --global "Travis"

	# Install the dependencies
	cd doc
	echo "-- Installing dependencies"
	conda install matplotlib Pillow sphinx
	pip install -r requirements_doc.txt

	# Making the doc
	echo "-- Building doc"
	make html

	# If build succeeded, update website
	if [ $? -eq 0 ]; then
		echo 'Documentation was successfully built, updating the website.'
		cd ..

		echo "-- Cloning doc repo"
		git clone --quiet doc_folder
		cd doc_folder
		git rm -r dev/*
		mkdir -p dev
		cp -r ../doc/_build/html/* dev/

		echo "Pushinng to git"
		git add dev
		git commit -m "Travis auto-update"
		git push --force --quiet "https://${gh_token}" > /dev/null 2>&1
	# Build failed
		echo '-- Build FAILED. Not updating the website.'
    echo "NOT BUILDIGN DOC -- will only push docs from master and if DEPLOY_DOCS == 1"

back to top