summaryrefslogtreecommitdiff
path: root/publish.sh
blob: 2294af102a2da7ea9abeb2ebc3471b188dd69c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -eox pipefail

base="$(realpath $(dirname "$0"))"
git checkout main
hash="$(git rev-parse HEAD| head -c 12)"
temp="/tmp/site-$hash"

git push
zola build
cd /tmp
git clone --branch pages "$base" "$temp"
cd "$temp"
git rm -r "*" || :
cp -ar "$base"/public/* "$base"/public/.* "$base"/.domains .
git add --all
git commit -m "Publish $hash" || :
git remote add cb 'ssh://git@codeberg.org/lsof/pages.git'
git push cb
cd
rm -rf "$temp"