21 lines
375 B
Bash
Executable File
21 lines
375 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# stop on error
|
|
set -e -v
|
|
|
|
# check if initial git run
|
|
if [ ! -d /repo ]; then
|
|
# yes - repo needs to be cloned
|
|
git clone --recurse-submodules $REPO_URL /repo
|
|
else
|
|
# no - pull existing repo
|
|
cd /repo && git pull --recurse-submodules
|
|
fi
|
|
|
|
# build and copy over
|
|
cd /repo && \
|
|
hugo && \
|
|
rm -rf /usr/share/nginx/html/* && \
|
|
cp -R /repo/public/* /usr/share/nginx/html
|
|
|