Add caching to CI build config

parent 41ee28d5
Pipeline #83253 passed with stages
in 9 minutes and 15 seconds
......@@ -3,11 +3,16 @@ stages:
- build
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
eslint:
stage: test
image: node:13.8
image: node:14
before_script:
- npm install
- npm ci --cache .npm --prefer-offline
script:
- npm run eslint
......
......@@ -4,22 +4,21 @@
# First stage: Build project
FROM node:14 as build
ARG NPM_BUILD_COMMAND=build
# Copy files and install dependencies
COPY ./ /gatsby/
WORKDIR /gatsby
# Install needed libraries
RUN apt-get update && apt-get install -y libgl1-mesa-glx
# Install dependencies
RUN npm install && \
npm audit fix
# Install gatsby-cli
RUN npm install -g gatsby-cli
# Build project
# Copy files (+cache) and install dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Copy source files and build project
COPY ./ /gatsby/
ARG NPM_BUILD_COMMAND=build
RUN npm run $NPM_BUILD_COMMAND
# Prepare nginx configuration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment