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