1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-07-01 02:19:09 +00:00

Added deploy script to push built files to gh-pages

This commit is contained in:
Alan Velasco 2019-06-25 19:24:28 -07:00
parent 57d4cdb63b
commit feee6da8b1
3 changed files with 19 additions and 24 deletions

View File

@ -35,7 +35,8 @@
"scripts": {
"build": "./scripts/generate",
"test": "phantomjs ./src/test/testrunner.js",
"prepublish": "run-s build test"
"deploy": "./scripts/deploy.sh gh-pages-new 12.0.4",
"prepublish": "run-s version build test deploy"
},
"dependencies": {
"twemoji-parser": "12.0.0"

View File

@ -1,23 +0,0 @@
#!/bin/bash
root=$(
cd $(dirname $0)
/bin/pwd
)
dir=$1
out=/tmp/school.$$
trap "rm -fr $out" 0 1 2
git clone $root/.git $out
cd $out
git remote set-url origin git@github.com:twitter/scala_school.git
git fetch
git checkout gh-pages
cd $root
cp -r $dir/* $out/
cd $out
git add .
git commit -am"publish by $USER"
git push origin gh-pages

17
scripts/deploy.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
ROOT=$(
cd $(dirname $0)/..
/bin/pwd
)
OUTPUT="$ROOT/dist/"
PUBLISH_BRANCH=$1
VERSION=$2
git fetch --all
git add -f $OUT
git checkout $PUBLISH_BRANCH
git pull origin $PUBLISH_BRANCH
git mv -f $OUT $VERSION
git commit -m "Update the Twemoji project and push to $PUBLISH_BRANCH"
git push origin $PUBLISH_BRANCH