publish.sh
-rwxr-xr-x 544 B
1#!/bin/sh
2# This is an automated deployment script for use in Ayllu from which this
3# website is hosted.
4set -x
5
6GENERATED_BRANCH="generated"
7
8if git status --porcelain | grep -q .; then
9 echo "repository dirty, aborting"
10 exit 1
11fi
12
13if [ "$(git rev-parse --abbrev-ref HEAD)" -ne "main" ]; then
14 echo "repository needs to be on the main branch"
15 exit 1
16fi
17
18git checkout "$GENERATED_BRANCH" --
19git reset --hard main
20git clean -fd
21
22zola build
23
24git add -f public
25git commit -m 'automated www update'
26
27git checkout main