Merge branch 'Adding-GitLab-Workflows' into 'main'

Adding git lab workflows

See merge request SinusFox/Operations-Research-Tool!43
This commit was merged in pull request #61.
This commit is contained in:
2024-10-14 16:26:30 +00:00
+80
View File
@@ -0,0 +1,80 @@
# Define the stages of the pipeline
stages:
- install
- build
- test
- deploy
# Job to install dependencies
install_dependencies:
stage: install
image: node:16
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:16
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:16
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