Newer
Older
# default image for jobs
default:
image: node:11
# cache modules between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
## BUILD ##
build:
stage: build
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- cp config.sample.json config.json
- npm run build
artifacts:
when: on_success
expire_in: 1 day
paths:
- dist/
tags:
- test
services:
- name: ${CI_REGISTRY_IMAGE}/server:0.1
before_script:
# install missing dependencies
- npm install -g sirv-cli
- npm install cypress-localstorage-commands
# making sure the process is orphan
- sirv dist --port 3000 > /dev/null 2>&1 &
script:
- cypress run -e CYPRESS_baseUrl=http://localhost:3000
tags:
- test
include:
project: infra/gitlab
ref: master
file: templates/deploy.ci.yml
name: test1
url: https://test1.startinblox.com
name: test2
url: https://test2.startinblox.com
stage: integration
environment:
name: test3
url: https://test3.startinblox.com
only:
stage: acceptance
environment:
name: stg1
url: https://stg1.startinblox.com
only:
name: stg2
url: https://stg2.startinblox.com
- /^release\/.*/
when: manual
## RELEASE TAGGING ##
publish:
stage: release
script:
- npm install -g semantic-release@v17 @semantic-release/gitlab@v6.0.5
- semantic-release
only:
- master
tags:
- deploy