From a5633fb9facb06de6ceafb4e67120781fd4a08c5 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Fri, 11 Nov 2022 16:14:34 -0500 Subject: [PATCH] CI.. or something --- .gitignore | 1 + .woodpecker.yml | 20 ++++++++++++++++++++ deploy.sh | 23 +++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 deploy.sh diff --git a/.gitignore b/.gitignore index 73ab876..aa59e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ public/ resources/ +pages.git/ diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..75a52ea --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,20 @@ +--- +branches: main + +clone: + git: + image: woodpeckerci/plugin-git + settings: + recursive: true + +pipeline: + build: + image: registry.gitlab.com/pages/hugo/hugo_extended:latest + commands: + - hugo + + publish: + image: ubuntu-latest + commands: + - ./deploy.sh + diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..dc64095 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/bash -ex + +REMOTE=$(git remote get-url origin) + +rm -fr pages.git +mkdir pages.git + +( cd pages.git && git init -b pages ) +rsync -av public/* pages.git + +cat << EOF > pages.git/.domains +neilhanlon.me +neilhanlon.com +hanlon.ninja +thepotato.tech +EOF + +cd pages.git + +git add -A +git commit -m "Deployment at $(date -u -Is)" +git remote add origin $REMOTE +git push -f origin pages