Skip to content

Commit

Permalink
Add gh-pages publish script for Linux/macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo committed Apr 16, 2020
1 parent 256d937 commit 18910c7
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -ex

# Setup

TMP=$(mktemp -qdt "$(basename $0).XXXXXX" 2>/dev/null || mktemp -q -d)
trap "rm -rf $TMP" 0

rev=$(git rev-parse --short HEAD | tr -d "\n")

# Build

node build
cp -a dist/ $TMP

# Checkout: master -> gh-pages

git checkout gh-pages

# Publish

cp -a $TMP/* .

git add -A .
git commit -m "Publish: '${rev}'"
git push [email protected]:smogon/damage-calc.git --force gh-pages

# Checkout: gh-pages -> master

git checkout -

0 comments on commit 18910c7

Please sign in to comment.