tools: release script for github pages

This commit is contained in:
He4eT 2024-01-14 22:18:51 +01:00
commit 231925c47c

23
tools/gh.release.sh Executable file
View file

@ -0,0 +1,23 @@
#! /bin/bash
GIT_ROOT=`git rev-parse --show-toplevel`
CURRENT_TIMESTAMP=`date +"%Y-%m-%d-%H%M%S"`
RELEASE_BRANCH='release'
BUILD_DIR='docs'
git checkout master
git branch -D $RELEASE_BRANCH
git checkout -b $RELEASE_BRANCH
rm -rf "$GIT_ROOT/$BUILD_DIR"
npm run build
git add "$GIT_ROOT/$BUILD_DIR"
git commit -m "release: $CURRENT_TIMESTAMP"
git push -f origin $RELEASE_BRANCH
rm -rf "$GIT_ROOT/$BUILD_DIR"
git checkout master