<commit_before>#!/bin/bash
set -eu # Exit with nonzero exit code if anything fails
PAGES_BRANCH="gh-pages"

echo "Setup ssh"
eval `ssh-agent -s`
ssh-add <(echo "$GITHUB_DEPLOY_PRIVATE_KEY" | base64 -d)
mkdir -p ~/.ssh
echo "github.com ssh-rsa ${GITHUB_PUBLIC_KEY}" >>~/.ssh/known_hosts

echo "Clone ${PAGES_BRANCH} branch"
cd dist
git clone https://github.com/tocco/tocco-client.git $PAGES_BRANCH --single-branch --branch $PAGES_BRANCH --depth 1

echo "Copy storybook to folder in repo"
BRANCH_FOLDER_NAME="${CI_COMMIT_BRANCH//\//_}"
echo "folder name: ${BRANCH_FOLDER_NAME}"
rm -rf $PAGES_BRANCH/$BRANCH_FOLDER_NAME
mkdir $PAGES_BRANCH/$BRANCH_FOLDER_NAME
mv storybook/* $PAGES_BRANCH/$BRANCH_FOLDER_NAME
cd $PAGES_BRANCH

echo "Commit and push"
git config user.name "Gitlab CI"
git config user.email "<EMAIL>"

git add -A
rev=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD || git commit -m "rebuild storybook at ${rev}"

git push -q <EMAIL>:tocco/tocco-client.git HEAD:$PAGES_BRANCH<commit_msg>chore: fix ci parallel problem<commit_after>#!/bin/bash
set -eu # Exit with nonzero exit code if anything fails
PAGES_BRANCH="gh-pages"

echo "Setup ssh"
eval `ssh-agent -s`
ssh-add <(echo "$GITHUB_DEPLOY_PRIVATE_KEY" | base64 -d)
mkdir -p ~/.ssh
echo "github.com ssh-rsa ${GITHUB_PUBLIC_KEY}" >>~/.ssh/known_hosts

echo "Clone ${PAGES_BRANCH} branch"
cd dist
git clone https://github.com/tocco/tocco-client.git $PAGES_BRANCH --single-branch --branch $PAGES_BRANCH --depth 1

echo "Copy storybook to folder in repo"
BRANCH_FOLDER_NAME="${CI_COMMIT_BRANCH//\//_}"
echo "folder name: ${BRANCH_FOLDER_NAME}"
rm -rf $PAGES_BRANCH/$BRANCH_FOLDER_NAME
mkdir $PAGES_BRANCH/$BRANCH_FOLDER_NAME
mv storybook/* $PAGES_BRANCH/$BRANCH_FOLDER_NAME
cd $PAGES_BRANCH

echo "Commit and push"
git config user.name "Gitlab CI"
git config user.email "<EMAIL>"

git add -A
rev=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD || git commit -m "rebuild storybook at ${rev}"

git pull --rebase origin $PAGES_BRANCH
git push -q <EMAIL>:tocco/tocco-client.git HEAD:$PAGES_BRANCH
{'fraction_non_alphanumeric': 0.13429951690821257, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 5.020348837209302, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '958655', 'n_tokens_mistral': 884, 'n_tokens_neox': 812, 'n_words': 216}