-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
43 lines (36 loc) · 1022 Bytes
/
.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
image: paciolanhub/alpine-node-dev:10.15.3c
variables:
REPO_URL: gitlabdev.paciolan.info
GITHUB_URL: https://github.com/Paciolan/eslint-config-react.git
stages:
- build
- deploy
Build & Test:
stage: build
except:
- tags
before_script:
- npm ci
script:
- npm run lint
Deploy:
stage: deploy
environment: NPM
only:
- master
except:
- tags
before_script:
# add git ssh key
- ssh-keyscan $SSH_KNOWN_HOSTS >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$GIT_SSH_PRIV_KEY" | ssh-add -
script:
# npm publish is dumb and will include this file
- rm changelog.config.js
# set repository to github for npm link
- node -e "require('fs').writeFileSync('./package.json', JSON.stringify(Object.assign(require('./package.json'), {repository:{type:'git',url:'$GITHUB_URL'}}), null, 2), 'utf8')"
# publish
- npx semantic-release
# debug
- echo published to https://www.npmjs.com/package/$(node -p "require('./package.json').name")