GitLab Pipeline Next.js Example
Example GitLab CI/CD pipeline for Next.js
image: node:latest
stages:
- install
- build
- parallel
# Caching speeds up installs across jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
install-deps:
stage: install
script:
- npm install
build-site:
stage: build
script:
- npm run build
dependencies:
- install-deps
artifacts:
paths:
- .next/
- out/ # include if you're using `next export`
expire_in: 1 hour
parallel-job:
stage: parallel
script:
- echo "I'm running at the same time as build-site!"