diff --git a/package.json b/package.json index b628bc4a..3fb8acf2 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/release.sh b/release.sh deleted file mode 100644 index 41b1d122..00000000 --- a/release.sh +++ /dev/null @@ -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 diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 00000000..d5d6c980 --- /dev/null +++ b/scripts/deploy.sh @@ -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 \ No newline at end of file