-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
49 lines (44 loc) · 1.18 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
stages:
- build
- publish
# Cache dependencies across jobs only pulling not uploading (upload to cache
# happens in build stage)
cache:
policy: pull # only pull cache, skip uploading
key: $CI_COMMIT_REF_SLUG
paths:
- .yarn
# Script run before all stages unless otherwise overriden
before_script:
- yarn install --frozen-lockfile --cache-folder .yarn # Install dependencies skipping Cypress
variables:
CYPRESS_CACHE_FOLDER: $CI_PROJECT_DIR/cache/Cypress
# Unit Testing Stage
# Run unit tests for Cloud Functions
Build:
stage: build
image: node:8
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
- $CI_COMMIT_MESSAGE =~ /skip-unit-tests/
artifacts:
name: $CI_JOB_STAGE-$CI_COMMIT_REF_SLUG
expire_in: 2 weeks
paths:
- dist
# Override cache behavior set above since we want to both pull and push to
# the cache (no "policy" provided since pull-push is default)
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .yarn
script:
- yarn --cwd react-feathers build # Build feathers
Publish:
stage: publish
image: node:8
when: manual
script:
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish