Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 2.15 KiB
image: node:16-alpine
stages:
- test
- build
- deploy
- release
# Prevent detached merge request pipelines
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/
# Those do not run the environment on_stop jobs when MRs are closed/merged
# or when branches get deleted, unlike branch pipelines.
workflow:
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: never
- when: always
before_script:
- npm ci
lint:
stage: test
script:
- npm run lint
audit:
stage: test
script:
- npm audit --parseable
allow_failure: true
build-webext:
stage: build
# Ignore frontend-audit to speed up CI builds
needs:
- lint
artifacts:
paths:
- dist-ext
expire_in: 2 weeks
script:
- npm run build-ext
build-lib:
stage: build
# Ignore frontend-audit to speed up CI builds
needs:
- lint
artifacts:
paths:
- dist-lib
expire_in: 2 weeks
script:
- npm run build-lib
# Only deploy branches on surge
rules:
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "master"'
when: on_success
- when: never
.surge:
stage: deploy
environment:
name: ${CI_COMMIT_REF_SLUG}
before_script: