-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
91 lines (85 loc) · 1.72 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# This is an internal setup used by Good Praxis.
# If this is not run on Good Praxis servers, you need to change it.
stages:
- build
- test
- review
- deploy
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- .npm
- cache/Cypress
build:static:
stage: build
image: cypress/base:12
script:
- npm ci
- npx danger ci
- npx gatsby build --prefix-paths
artifacts:
paths:
- public/
only:
- merge_requests
- master
- tags
test:
stage: test
image: cypress/base:12
script:
- npm ci
- npx cypress cache path
- npx cypress cache list
- npm run lint
- npm test
after_script:
- npm run test:merge
coverage: /All\sfiles.*?\s+(\d+.\d+)/
artifacts:
expire_in: 1 week
paths:
- cypress/screenshots
- cypress/videos
reports:
junit: merged-junit.xml
only:
- merge_requests
- master
- tags
review:
stage: review
script:
- rsync -av --delete public /srv/nginx/pages/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
dependencies:
- build:static
environment:
name: review/$CI_BUILD_REF_NAME
url: https://$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$APPS_DOMAIN
on_stop: stop_review
only:
- merge_requests
tags:
- nginx
- review-apps
- goodpraxis
stop_review:
stage: review
script:
- rm -rf public /srv/nginx/pages/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
variables:
GIT_STRATEGY: none
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- merge_requests
tags:
- nginx
- review-apps
- goodpraxis