This commit is contained in:
Tiemen van Olst
2025-09-08 15:37:49 +02:00
parent 2575f6e769
commit 7f1595dddd

View File

@@ -1,12 +1,14 @@
#!/bin/bash #!/bin/bash
set -e set -e
# Als repo nog niet bestaat, clone TEMP_DIR="/tmp/nuxt_repo"
# Als repo nog niet bestaat, clone naar tijdelijke map
if [ ! -d ".git" ]; then if [ ! -d ".git" ]; then
echo "Cloning repo..." echo "Cloning repo to temporary folder..."
echo "GIT_REPO_URL: ${GIT_REPO_URL}" git clone -b ${GIT_BRANCH:-main} ${GIT_REPO_URL} $TEMP_DIR
echo "GIT_BRANCH: ${GIT_BRANCH:-main}" echo "Copying files to /app..."
git clone -b ${GIT_BRANCH:-main} ${GIT_REPO_URL} . cp -R $TEMP_DIR/* $TEMP_DIR/.[!.]* /app/ 2>/dev/null || true
else else
echo "Pulling latest changes..." echo "Pulling latest changes..."
git reset --hard git reset --hard
@@ -14,10 +16,10 @@ else
git pull origin ${GIT_BRANCH:-main} git pull origin ${GIT_BRANCH:-main}
fi fi
# Dependencies # Dependencies installeren
npm ci npm ci
# Build # Build Nuxt
npm run build npm run build
# Start Nuxt # Start Nuxt