Skip to content

Instantly share code, notes, and snippets.

@mngyuan
Created February 6, 2020 21:01
Show Gist options
  • Save mngyuan/638fa1f858cbb3645943c8c4266e01e3 to your computer and use it in GitHub Desktop.
Save mngyuan/638fa1f858cbb3645943c8c4266e01e3 to your computer and use it in GitHub Desktop.
Gitlab CI config for nextjs
image: node:alpine
# Cache node modules - speeds up future builds
cache:
paths:
- node_modules
pages:
stage: deploy
script:
- npm install
- npm run build
- npm run export
- mv public _public # nextjs reserves the public folder, but so does gitlab
- mv out public
artifacts:
paths:
- public
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment