From 87dc67d0cd55454ff65a90ffa8839b4caef6e3b5 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 8 Sep 2020 12:59:37 +0100 Subject: [PATCH] Update CI scripts --- bin/ci-pre-build.sh | 10 ++++++++++ bin/ci-push.sh | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 bin/ci-pre-build.sh create mode 100755 bin/ci-push.sh diff --git a/bin/ci-pre-build.sh b/bin/ci-pre-build.sh new file mode 100755 index 000000000..6f4b0ca78 --- /dev/null +++ b/bin/ci-pre-build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Install latest current release from npm +# (we need to force because otherwise npm will refuse to install a module of the same name) + +npm --force install tiddlywiki || exit 1 + +# Pull existing GitHub pages content + +git clone --depth=1 --branch=master "https://github.com/Jermolene/jermolene.github.io.git" output diff --git a/bin/ci-push.sh b/bin/ci-push.sh new file mode 100755 index 000000000..670d2acdf --- /dev/null +++ b/bin/ci-push.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Push output back to GitHub + + +cd output || exit 1 + +git config --global user.email "actions@github.com" || exit 1 + +git config --global user.name "GitHub Actions" || exit 1 + +git add -A . || exit 1 + +git commit --message "GitHub build: $GITHUB_RUN_NUMBER of $TW5_BUILD_BRANCH ($(date +'%F %T %Z'))" || exit 1 + +git remote add deploy "https://$GH_TOKEN@github.com/Jermolene/jermolene.github.io.git" &>/dev/null || exit 1 + +git push deploy master &>/dev/null || exit 1 + +cd .. || exit 1