<commit_before>#!/bin/bash
set -ev

# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key

cd ../

# fetch and build vivliostyle-js-viewer
gem install compass
git clone --depth=1 --branch=master <EMAIL>@github.com:vivliostyle/vivliostyle-js-viewer.git vivliostyle-js-viewer
cd vivliostyle-js-viewer
npm run setup-local-vivliostyle ../vivliostyle.js
npm install
npm run build
npm run test-sauce

# make distribution package
version=$(grep '^ *"version":' node_modules/vivliostyle/package.json | sed -e 's/^.*"\([^"]*\)",$/\1/')
scripts/make-dist-package.sh ${version}

cd ../

# fetch gh-pages branch
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages

# git configuration
git config user.email "<EMAIL>"
git config user.name "kwkbtr (Travis CI)"

# update gh-pages branch
cp -R ../vivliostyle-js-viewer/build/* viewer/

zip="../vivliostyle-js-viewer/vivliostyle-js-viewer-latest.zip"
if [ -e ${zip} ]; then
    mv ${zip} downloads/
fi

git add viewer
git commit -m "Update vivliostyle.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages<commit_msg>Deploy distribution package to gh-pages; add `git status` so that the changed files are on the log<commit_after>#!/bin/bash
set -ev

# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key

cd ../

# fetch and build vivliostyle-js-viewer
gem install compass
git clone --depth=1 --branch=master <EMAIL>:vivliostyle/vivliostyle-js-viewer.git vivliostyle-js-viewer
cd vivliostyle-js-viewer
npm run setup-local-vivliostyle ../vivliostyle.js
npm install
npm run build
npm run test-sauce

# make distribution package
version=$(grep '^ *"version":' node_modules/vivliostyle/package.json | sed -e 's/^.*"\([^"]*\)",$/\1/')
scripts/make-dist-package.sh ${version}

cd ../

# fetch gh-pages branch
git clone --depth=1 --branch=gh-pages <EMAIL>:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages

# git configuration
git config user.email "<EMAIL>"
git config user.name "kwkbtr (Travis CI)"

# update gh-pages branch
cp -R ../vivliostyle-js-viewer/build/* viewer/

zip="../vivliostyle-js-viewer/vivliostyle-js-viewer-latest.zip"
if [ -e ${zip} ]; then
    mv ${zip} downloads/
fi

git add .
git status
git commit -m "Update vivliostyle.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
{'fraction_non_alphanumeric': 0.1535810034469552, 'fraction_numerical': 0.006127920337035618, 'mean_word_length': 3.994263862332696, 'pattern_counts': {'":': 2, '<': 8, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1988940', 'n_tokens_mistral': 1026, 'n_tokens_neox': 962, 'n_words': 248}