diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a48dd9b..be9d76f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,6 @@ -image: node:lts-bullseye +image: + name: node:18 + pull_policy: if-not-present stages: - build @@ -10,10 +12,10 @@ gatsby-build: CHOKIDAR_USEPOLLING: 1 cache: paths: - - node_modules/ + - .npm/ script: - - bash cached-restore.sh - - yarn run build + - npm ci --cache .npm --prefer-offline + - npm run build artifacts: paths: - public diff --git a/cached-restore.sh b/cached-restore.sh deleted file mode 100755 index d4af6dd..0000000 --- a/cached-restore.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if cmp -s "package-lock.json" "node_modules/package-lock.json"; then - echo "package-lock.json did not change, skipping install" -else - echo "package-lock.json changed, reinstalling packages" - npm config set registry https://registry.npmmirror.com - npm ci - cp package-lock.json node_modules/package-lock.json -fi