-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
87 lines (76 loc) · 1.94 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
include:
- ci-templates/node.yml
- packages/core/.gitlab-ci.yml
- packages/common/.gitlab-ci.yml
- packages/memo/.gitlab-ci.yml
- packages/persistence/.gitlab-ci.yml
- packages/nestjs-httyped-client/.gitlab-ci.yml
- packages/nestjs/.gitlab-ci.yml
- packages/httyped-client/.gitlab-ci.yml
stages:
- prepare
- test
- compile
- doc
- publish
- release
## install node dependencies
node:prepare:
stage: prepare
extends: .node-cache
cache:
policy: pull-push
script:
- npm ci --cache .npm --prefer-offline --include=dev
### DOCS
docs:
extends: .node:build
variables:
ARTIFACT_PATH: packages/docs/dist/
stage: doc
needs:
- node:prepare
script:
- npm run docs:build
artifacts:
expire_in: 20 min
docs:publish:
image: alpine
stage: release
before_script:
- apk add git openssh-client
- mkdir -p ~/.ssh
- cp $PAGES_SSH_PRIVATE_KEY ~/.ssh/id_rsa
- ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
- chmod -R 600 ~/.ssh
- git config --global user.email "[email protected]"
- git config --global user.name "Gitlab CI"
needs:
- docs
script:
- cd packages/docs/
- rm -rf .git .gitignore
- git init --initial-branch=main
- git add . dist .gitlab-ci.yml
- git commit -m"deploy doc"
- git push -f [email protected]:aspectjs/aspectjs.gitlab.io.git main
rules:
- if: $CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_REF_NAME =~ /^v\d+\.\d+\.\d+.*$/
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_REF_NAME'
description: '$CI_COMMIT_REF_NAME'
rules:
- if: $CI_COMMIT_REF_NAME =~ /^v\d+\.\d+\.\d+.*$/
when: manual
.coverage:
extends: .node:test:unit
stage: test
needs:
- node:prepare
script:
- npm run test:coverage