-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
68 lines (62 loc) · 1.46 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
stages:
- build
- test
- deploy
cache:
paths:
- node_modules/
################
# node latest
################
build_node:latest:
stage: build
image: node:latest
script:
- npm install
- npm run build
artifacts:
name: "qhun-transpiler.$CI_COMMIT_REF_SLUG.$CI_PIPELINE_IID"
when: on_success
paths:
- dist/
- readme.md
- package.json
- LICENSE
test_node:latest:
stage: test
image: node:latest
script:
- npm install
- npm run coverage
coverage: '/\d+\.\d+\%\ \(/'
#########################
# DEPLOY TO GITHUB.COM
#########################
deploy:GitHub:
stage: deploy
when: on_success
script:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H 22 "github.com" >> ~/.ssh/known_hosts
- git remote add github git@github.com:wartoshika/qhun-transpiler.git || true
- git push github -u $CI_COMMIT_SHA:$CI_COMMIT_REF_NAME --follow-tags --force
only:
- master
- dev
######################
# DEPLOY TO NPMJS.ORG
######################
deploy:NPM:
stage: deploy
image: node:latest
when: on_success
dependencies:
- build_node:latest
script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- npm publish
only:
- tags
- triggers