Update .gitlab-ci.yml file

This commit is contained in:
2025-11-13 01:23:30 +01:00
parent 8fa24f0db7
commit 01fa133ad1

View File

@@ -1,6 +1,6 @@
# ----------------------------------------- # -----------------------------------------
# USBcheck.it GitLab CI/CD Pipeline # USBcheck.it GitLab CI/CD Pipeline
# Build: pnpm # Build: pnpm (z.B. Astro)
# Deploy: FTPS (lftp) → all-inkl # Deploy: FTPS (lftp) → all-inkl
# ----------------------------------------- # -----------------------------------------
@@ -11,6 +11,8 @@ stages:
variables: variables:
NODE_ENV: production NODE_ENV: production
# Falls dein Build woanders hin schreibt (z.B. "build" oder ".output/public"):
# HIER anpassen!
BUILD_DIR: dist BUILD_DIR: dist
# ----------------------------------------- # -----------------------------------------
@@ -33,7 +35,7 @@ cache:
- node_modules/ - node_modules/
# ----------------------------------------- # -----------------------------------------
# 1. Install dependencies # 1. Dependencies installieren
# ----------------------------------------- # -----------------------------------------
install: install:
stage: install stage: install
@@ -47,7 +49,7 @@ install:
expire_in: 1h expire_in: 1h
# ----------------------------------------- # -----------------------------------------
# 2. Build project # 2. Projekt bauen
# ----------------------------------------- # -----------------------------------------
build: build:
stage: build stage: build
@@ -57,6 +59,10 @@ build:
script: script:
- echo "🏗️ Building..." - echo "🏗️ Building..."
- pnpm build - pnpm build
- echo "📂 Build-Output (Top-Level):"
- ls -la
- echo "📂 Inhalt von ${BUILD_DIR} (falls vorhanden):"
- if [ -d "${BUILD_DIR}" ]; then ls -la "${BUILD_DIR}"; else echo "⚠️ Verzeichnis ${BUILD_DIR} existiert NICHT!"; fi
- echo "✅ Build complete." - echo "✅ Build complete."
artifacts: artifacts:
paths: paths:
@@ -64,17 +70,23 @@ build:
expire_in: 1 week expire_in: 1 week
# ----------------------------------------- # -----------------------------------------
# 3. Template für FTPS Deployment # 3. Template für FTPS-Deployment
# ----------------------------------------- # -----------------------------------------
.deploy_ftps_template: &deploy_ftps .deploy_ftps_template: &deploy_ftps
stage: deploy stage: deploy
image: alpine:3.20 image: alpine:3.20
dependencies: dependencies:
- build # <<< sehr wichtig: Lade Build-Artefakte - build # <<< ganz wichtig: lade Artefakte vom Build-Job
before_script: before_script:
- echo "📡 Installing lftp..." - echo "📡 Installing lftp..."
- apk add --no-cache lftp - apk add --no-cache lftp
- echo "📂 Dateien im CI-Workspace vor Deploy:"
- pwd
- ls -la
- echo "📂 Inhalt von ${BUILD_DIR} (Deploy-Job):"
- if [ -d "${BUILD_DIR}" ]; then ls -la "${BUILD_DIR}"; else echo "❌ ${BUILD_DIR} existiert HIER nicht!"; fi
script: script:
- if [ ! -d "${BUILD_DIR}" ]; then echo "❌ Abbruch: Build-Verzeichnis ${BUILD_DIR} fehlt im Deploy-Job."; exit 1; fi
- echo "🚀 Deploy via FTPS to $FTP_HOST:$FTP_PATH ..." - echo "🚀 Deploy via FTPS to $FTP_HOST:$FTP_PATH ..."
- lftp -e " - lftp -e "
set ftp:ssl-force true; set ftp:ssl-force true;