-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
54 lines (52 loc) · 1.43 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
stages:
- build
- pre-publish
- publish
variables:
GITLAB_TOKEN: $GITLAB_TOKEN
NPM_TOKEN: $NPM_TOKEN
before_script:
- npm install
- git config --global user.name "assets.system"
- git config --global user.email "[email protected]"
publish:
stage: publish
only:
- master
except:
- tags
- triggers
when: manual
script:
- echo "Checking current Git user...!"
- git config --get user.name
- echo "Checking current Git email..."
- git config --get user.email
- echo "Manually triggered publish for master branch..."
- git remote set-url origin "https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.okg.com/okfe/im.git"
- git checkout $CI_COMMIT_REF_NAME
- git pull origin $CI_COMMIT_REF_NAME
- npm run release --ci --token ${GITLAB_TOKEN}
tags:
- nodejs18
docs-publish:
stage: publish
only:
- /^dev\/\d+\.\d+.\d+$/
except:
- tags
- triggers
when: manual
script:
- nvm use v20.11.0
- echo "Checking current Git user...!"
- git config --get user.name
- echo "Checking current Git email..."
- git config --get user.email
- echo "Manually triggered docs publish for dev branch..."
- git remote set-url origin "https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.okg.com/okfe/im.git"
- git checkout $CI_COMMIT_REF_NAME
- git pull origin $CI_COMMIT_REF_NAME
- cd packages/docs && pnpm run build && pnpm run upload
tags:
- nodejs18