This repository has been archived on 2026-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Operations-Research-Tool/.gitlab-ci.yml
T
2024-10-14 18:45:54 +00:00

81 lines
1.5 KiB
YAML

# Define the stages of the pipeline
stages:
- install
- build
- test
- deploy
# Job to install dependencies
install_dependencies:
stage: install
image: node:20
script:
- npm ci
cache:
paths:
- node_modules/
artifacts:
paths:
- node_modules/
# Run automatically on PRs to main
only:
- merge_requests
- main
# Allow manual execution
when: manual
# Job to build the Next.js project
build_nextjs:
stage: build
image: node:20
script:
- npm run build
dependencies:
- install_dependencies
cache:
paths:
- .next/
artifacts:
paths:
- .next/
# Run automatically on PRs to main
only:
- merge_requests
- main
# Allow manual execution
when: manual
# Job to run tests
run_tests:
stage: test
image: node:20
script:
- npm test # Replace with your test command (e.g. jest)
dependencies:
- install_dependencies
artifacts:
when: always
paths:
- test-reports/
# Run automatically on PRs to main
only:
- merge_requests
- main
# Allow manual execution
when: manual
# Deploy step (runs only on merge to main)
deploy:
stage: deploy
script:
- mkdir public
- cp -r .next/* public # Example for GitLab Pages, adjust as needed
artifacts:
paths:
- public
# Only run on merge to main branch
only:
- main
# Allow manual execution
when: manual