Commit bd0c3525 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Simplifie le workflow de CI.

parent d4084c4d
......@@ -2,55 +2,43 @@ include:
- local: 'prezbuilder-ci.yml'
default:
tags: [docker]
retry: 2
interruptible: true
stages:
- build
- test
- build
- deploy
node_modules:
stage: build
lint:
stage: test
tags: [docker]
image: node:12-buster
variables:
NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm"
script:
- npm install
- npm run lint
cache:
key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths:
- "$NPM_CONFIG_CACHE"
artifacts:
expire_in: 1 day
paths:
- node_modules/
docker-image:
stage: build
tags: [dind]
variables:
PUBLIC_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
PREZBUILDER_IMAGE: prezbuilder
PREZBUILDER_TAG: "$CI_COMMIT_SHA"
LOCAL_IMAGE: "$PREZBUILDER_IMAGE:$PREZBUILDER_TAG"
IMAGE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
PREZBUILDER_IMAGE: "${CI_REGISTRY_IMAGE}"
PREZBUILDER_TAG: "${CI_COMMIT_REF_NAME}"
script:
- set -x
- docker pull "$PUBLIC_IMAGE" || exit 0
- docker build --cache-from "node:buster-12,$PUBLIC_IMAGE" --tag "$LOCAL_IMAGE" --tag "$PUBLIC_IMAGE" .
- docker run --rm "$LOCAL_IMAGE" build
- docker pull "${IMAGE}" || exit 0
- docker build --cache-from "node:buster-12,${IMAGE}" --tag "${IMAGE}" .
- docker run --rm "${IMAGE}" build
- bash -x bin/prezbuilder-docker build src public
- "[ -e public/index.html ]"
- docker push "$PUBLIC_IMAGE"
lint:
stage: test
image: node:12-buster
needs:
- node_modules
script:
- npm run lint
- docker push "${IMAGE}"
pages:
extends: .prezbuilder
......
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