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