Update CI scripts

This commit is contained in:
jeremy@jermolene.com 2020-09-08 12:59:37 +01:00
parent 68b455565b
commit 87dc67d0cd
2 changed files with 30 additions and 0 deletions

10
bin/ci-pre-build.sh Executable file
View File

@ -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

20
bin/ci-push.sh Executable file
View File

@ -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