17 lines
543 B
Bash
17 lines
543 B
Bash
|
#!/bin/bash
|
|||
|
set -euo pipefail
|
|||
|
|
|||
|
# Si le site a déjà été build par le passé, curl termine l’exécution du script en cas d’absence sur serveur corps.
|
|||
|
[ -f "$HTTP_DIR/public/index.html" ] && { curl -iI https://$RADIO_HOST/fic/_series-_index.fic >/dev/null || exit 0 ; }
|
|||
|
|
|||
|
# Update git repo
|
|||
|
git_update.sh -d "$HTTP_DIR" -o "-i $SECRET_DIR/gitlab-deploy.sshprivkey" -r "${GIT_SOURCE_BRANCH:-main}" "$GIT_SOURCE_REPO"
|
|||
|
|
|||
|
cd "$HTTP_DIR"
|
|||
|
|
|||
|
# Invalid cache
|
|||
|
rm -rf "/tmp/hugo_cache_$USER"
|
|||
|
|
|||
|
# Build website
|
|||
|
HUGO_CACHEDIR="/tmp/hugo_cache_$USER" hugo
|