From 9c17c4d3c30715d9934b92b924e156ae982c9791 Mon Sep 17 00:00:00 2001 From: "Codeberg.org" Date: Mon, 24 Aug 2020 21:27:11 +0200 Subject: [PATCH] deploy.sh --- .gitignore | 3 ++- deploy.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 deploy.sh diff --git a/.gitignore b/.gitignore index d0e4835..9870175 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -_site/ \ No newline at end of file +_site/ +pages.git/ diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..d1ad413 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,15 @@ +#!/bin/bash -ex + +npm install +npm run build + +rm -rf pages.git +git clone git@codeberg.org:docs/pages.git pages.git +rsync -av _site/* pages.git/ +( cd pages.git && git checkout --orphan current ) ## create new branch at origin +( cd pages.git && git add -A ) ## add all generated files +( cd pages.git && git commit -am "deployment" ) ## commit all +( cd pages.git && git branch -D main ) ## delete old main branch incl. history +( cd pages.git && git branch -m main ) ## rename current branch to main +( cd pages.git && git push -f origin main ) ## force-push and rewrite (empty) history +