Files
orbit/.gitlab-ci.yml

57 lines
1.1 KiB
YAML

default:
tags:
- runner
stages:
- build
- e2e
- image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
# Build de l'app Angular (vérifie aussi la compilation TypeScript)
build:
stage: build
image: node:22-alpine
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- node_modules/
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 day
# Tests end-to-end Playwright (l'image officielle contient Chromium)
e2e:
stage: e2e
image: mcr.microsoft.com/playwright:v1.65.0
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- node_modules/
script:
- npm ci
- npx playwright test --project=chromium
artifacts:
when: always
paths:
- e2e/.tmp/
expire_in: 1 week
# Build et push de l'image Docker sur le registre GitLab
docker-image:
stage: image
image: docker:27-cli
services:
- docker:27-dind
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build -t "$IMAGE_TAG" -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE:latest"