<commit_before>#!/bin/bash
set -e # exit with nonzero exit code if anything fails

# Clone *this* git repo, but only the gh-pages branch. We redirect any output to
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
if [[ ! -d $GH_PAGES_DIR ]]; then
    git clone -q -b gh-pages --single-branch https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $GH_PAGES_DIR 2>&1 >/dev/null
fi
cd $GH_PAGES_DIR

# inside this git repo we'll pretend to be a new user
git config user.name "Travis CI"
git config user.email "<EMAIL>"

if [[ "${TRAVIS_TAG}" != "" ]]; then
    export VERSION=${TRAVIS_TAG%.*}
else
    export VERSION=dev
fi

# The first and only commit to this new Git repo contains all the
# files present with the commit message "Deploy to GitHub Pages".
rm -rf ${VERSION}
cp -R ${TRAVIS_BUILD_DIR}/docs/build/html/ ${VERSION}/
touch .nojekyll
if [[ "${VERSION}" != "dev" ]]; then
    ln -shf ${VERSION} latest
fi

git add -A .
git commit -m "Deploy ${VERSION} to GitHub Pages"

# Push up to gh-pages
echo Pushing...
git push --quiet origin gh-pages<commit_msg>ENH: Combine consecutive dev deployments<commit_after>#!/bin/bash
set -e # exit with nonzero exit code if anything fails

# Clone *this* git repo, but only the gh-pages branch. We redirect any output to
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
if [[ ! -d $GH_PAGES_DIR ]]; then
    git clone -q -b gh-pages --single-branch https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $GH_PAGES_DIR 2>&1 >/dev/null
fi
cd $GH_PAGES_DIR

# inside this git repo we'll pretend to be a new user
git config user.name "Travis CI"
git config user.email "<EMAIL>"

if [[ "${TRAVIS_TAG}" != "" ]]; then
    export VERSION=${TRAVIS_TAG%.*}
else
    export VERSION=dev
fi

# The first and only commit to this new Git repo contains all the
# files present with the commit message "Deploy to GitHub Pages".
rm -rf ${VERSION}
cp -R ${TRAVIS_BUILD_DIR}/docs/build/html/ ${VERSION}/
touch .nojekyll
if [[ "${VERSION}" != "dev" ]]; then
    ln -shf ${VERSION} latest
fi

git add -A .
if [[ "${VERSION}" == "dev" && `git log -1 --format='%s'` == *"dev"* ]]; then
    git commit --amend --reset-author --no-edit
else
    git commit -m "Deploy ${VERSION} to GitHub Pages"
fi

# Push up to gh-pages
echo Pushing...
git push --force --quiet origin gh-pages
{'fraction_non_alphanumeric': 0.13711383834109184, 'fraction_numerical': 0.0021159542953872196, 'mean_word_length': 3.6535433070866143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '461185', 'n_tokens_mistral': 834, 'n_tokens_neox': 794, 'n_words': 312}