mkdir -p configs
cat > configs/service-frontend.yml << 'YAML'
stages:
- build
- test
frontend_build:
stage: build
image: node:22-alpine
script:
- npm ci
- npm run build -- --target frontend
artifacts:
paths:
- dist/frontend/
frontend_test:
stage: test
image: node:22-alpine
needs:
- frontend_build
script:
- npm run test -- --ci --coverage --target frontend
YAML
cat > configs/service-api.yml << 'YAML'
stages:
- build
- test
api_build:
stage: build
image: node:22-alpine
script:
- npm ci
- npm run build -- --target api
artifacts:
paths:
- dist/api/
api_test:
stage: test
image: node:22-alpine
needs:
- api_build
script:
- npm run test -- --ci --coverage --target api
YAML