From 7ed1f3e768fe5fa6922bc6929433de6f1fa139b0 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 20 Feb 2024 10:17:28 +0000 Subject: [PATCH] Deploy multiple themes to test --- tools/branch-deploy.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/branch-deploy.sh b/tools/branch-deploy.sh index 8c69c71..698a802 100755 --- a/tools/branch-deploy.sh +++ b/tools/branch-deploy.sh @@ -10,6 +10,9 @@ BASE_URL="$2" # Arguments to add to the Hugo call HUGO_ARGUMENTS="--gc" +# Themes to build instances of +THEMES="lhs lhs-retro" + # Ensure the target folder exists mkdir -p "${TARGET_FOLDER}" @@ -27,14 +30,18 @@ for BRANCH in $BRANCHES; do echo "Building ${BRANCH}" # Make folders - mkdir -p "${TARGET_FOLDER}/${BRANCH}" + for THEME in $THEMES; do + mkdir -p "${TARGET_FOLDER}/${BRANCH}/${THEME}" + done TEMP_FOLDER=`mktemp -u -d` # Checkout the branch git clone -q --branch "${BRANCH}" -- "file://${BARE_FOLDER}" "${TEMP_FOLDER}" # Build to the destination folder - hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}/${BRANCH}" -s "${TEMP_FOLDER}" -d "${TARGET_FOLDER}/${BRANCH}" + for THEME in $THEMES; do + hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}/${BRANCH}/${THEME}" -s "${TEMP_FOLDER}" -d "${TARGET_FOLDER}/${BRANCH}/${THEME}" -t "${THEME}" + done # Cleanup the temp folder rm -rf "${TEMP_FOLDER}" @@ -45,7 +52,11 @@ INDEX_PAGE="${TARGET_FOLDER}/index.html" echo -e "

Branches

\n\n

Last Updated: $(date)

" >> "${INDEX_PAGE}"