-
Notifications
You must be signed in to change notification settings - Fork 20
/
.gitlab-ci.yml
103 lines (93 loc) · 1.82 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
92
93
94
95
96
97
98
99
100
101
102
103
# START PLAYWRIGHT SPECIFIC CONFIG
default:
image: mcr.microsoft.com/playwright:v1.43.0-focal
stages:
- build
- test
- deploy
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm
- node_modules
- e2e/node_modules
spa_test:
stage: test
script:
- cp .env.dist .env
- npm install
- npm run lint
- npm run coverage
e2e_build:
stage: build
script:
- cp .env.dist .env
- npm ci
- npm run build:ci
- cd e2e && npm install && cd ..
artifacts:
paths:
- build/**
- e2e/node_modules/**
only:
- merge_requests
e2e_chrome:
stage: test
before_script:
- cp ./e2e/.env.dist ./e2e/.env
- cd e2e
script:
- npm run test:chrome
artifacts:
when: always
paths:
- e2e/test-report/
- e2e/test-results/
only:
- merge_requests
e2e_firefox:
stage: test
before_script:
- cp ./e2e/.env.dist ./e2e/.env
- cd e2e
script:
- npm run test:firefox
artifacts:
when: always
paths:
- e2e/test-report/
- e2e/test-results/
only:
- merge_requests
e2e_safari:
stage: test
before_script:
- cp ./e2e/.env.dist ./e2e/.env
- cd e2e
script:
- npm run test:safari
artifacts:
when: always
paths:
- e2e/test-report/
- e2e/test-results/
only:
- merge_requests
# END PLAYWRIGHT SPECIFIC CONFIG
deploy_to_staging:
stage: deploy
environment: staging
image:
name: tshio/awscli-docker-compose-pipelines:0.0.7
entrypoint: ['']
script:
- npm ci
- npm run build
- aws s3 sync ./build s3://"$S3_BUCKET" --delete
- aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_DISTRIBUTION" --paths "/*"
rules:
- when: manual