image: node:12 # add 'node_modules' to cache for speeding up builds cache: &global_cache key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ # Node modules and dependencies stages: - prepare - test - build - deploy prepare:deps: stage: prepare script: - yarn install - yarn next telemetry disable cache: <<: *global_cache policy: push test:build: stage: test script: - yarn run build cache: <<: *global_cache policy: pull pages: stage: deploy script: - yarn run build - yarn next export - rm -rf public - mv out public artifacts: paths: - public expire_in: 1 week only: - master cache: <<: *global_cache policy: pull
gitlab, nextjs, ssg — Mar 22, 2021