mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
Update .gitlab-ci.yml file
This commit is contained in:
+7
-31
@@ -16,47 +16,24 @@ default:
|
|||||||
.build_template: &build_template
|
.build_template: &build_template
|
||||||
stage: build
|
stage: build
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
key: npm-cache
|
key: npm-cache
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
NODE_ENV: ""
|
NPM_CONFIG_PRODUCTION: 'false'
|
||||||
NPM_CONFIG_PRODUCTION: "false"
|
NODE_ENV: ''
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# Install dependencies
|
- echo "Installing dependencies..."
|
||||||
- echo "📦 Installing dependencies..."
|
|
||||||
- npm ci --no-audit --no-fund
|
- npm ci --no-audit --no-fund
|
||||||
|
- echo "Build env used:"
|
||||||
# Print env used
|
|
||||||
- echo "✅ Build env used:"
|
|
||||||
- echo "NEXT_PUBLIC_LTI_URL=$NEXT_PUBLIC_LTI_URL"
|
- echo "NEXT_PUBLIC_LTI_URL=$NEXT_PUBLIC_LTI_URL"
|
||||||
- echo "NEXT_PUBLIC_SSO_LOGIN_URL=$NEXT_PUBLIC_SSO_LOGIN_URL"
|
- echo "NEXT_PUBLIC_SSO_LOGIN_URL=$NEXT_PUBLIC_SSO_LOGIN_URL"
|
||||||
- echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL"
|
- echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL"
|
||||||
|
- echo "Building Next.js static export..."
|
||||||
# Clean old output
|
|
||||||
- echo "🧹 Cleaning old build..."
|
|
||||||
- rm -rf .next out
|
|
||||||
|
|
||||||
# Build Next.js
|
|
||||||
- echo "🏗️ Running Next.js build..."
|
|
||||||
- npx next build
|
- npx next build
|
||||||
|
|
||||||
# Export static site
|
|
||||||
- echo "📤 Exporting static site..."
|
|
||||||
- npx next export
|
|
||||||
|
|
||||||
# Validate export result
|
|
||||||
- echo "🔍 Validating export output..."
|
|
||||||
- test -f out/index.html || (echo "❌ out/index.html missing" && exit 1)
|
|
||||||
- test -d out/_next/static || (echo "❌ out/_next/static missing" && exit 1)
|
|
||||||
|
|
||||||
# Build metadata
|
|
||||||
- echo "📝 Writing build-info.json..."
|
|
||||||
- |
|
- |
|
||||||
|
mkdir -p out
|
||||||
cat <<EOF > out/build-info.json
|
cat <<EOF > out/build-info.json
|
||||||
{
|
{
|
||||||
"commit": "$CI_COMMIT_SHORT_SHA",
|
"commit": "$CI_COMMIT_SHORT_SHA",
|
||||||
@@ -67,9 +44,8 @@ default:
|
|||||||
"NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
|
"NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "out-$CI_COMMIT_SHORT_SHA"
|
name: 'out-$CI_COMMIT_SHORT_SHA'
|
||||||
paths:
|
paths:
|
||||||
- out/
|
- out/
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|||||||
Reference in New Issue
Block a user