-
Notifications
You must be signed in to change notification settings - Fork 34
/
config.yml
134 lines (129 loc) · 3.62 KB
/
config.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
version: 2
jobs:
qa:
docker:
- image: circleci/node:14
- image: postgres
environment:
POSTGRES_PASSWORD: password
- image: minio/minio
environment:
MINIO_ACCESS_KEY: accessKeyId
MINIO_SECRET_KEY: secretAccessKey
command: server /data
steps:
- checkout
- run:
name: Install dependencies
command: yarn install --frozen-lockfile
- run:
name: Compile modules
command: yarn compile
- run:
name: Run linters
command: yarn lint
- run:
name: Run tests and calculate code coverage
command: npm run coverage
- run:
name: Publish code coverage report
command: yarn publish-coverage
publish-website:
docker:
- image: circleci/node:14
steps:
- checkout
- run:
name: Install dependencies
command: yarn install --frozen-lockfile
- run:
name: Compile website
command: yarn compile --scope=@staticdeploy/website
- run:
name: Install staticdeploy cli
command: |
yarn global add @staticdeploy/cli
echo 'export PATH=$PATH:$(yarn global bin)' >> $BASH_ENV
- run:
name: Create website bundle
command: staticdeploy bundle --config website/staticdeploy.config.js
- run:
name: Deploy website bundle
command: staticdeploy deploy --config website/staticdeploy.config.js
docker-build-push:
docker:
- image: circleci/node:14
steps:
- checkout
- setup_remote_docker:
version: 19.03.13
- run:
name: Install dependencies (commands below need lerna)
command: yarn install --frozen-lockfile
- run:
name: Login to Docker Hub
command: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- run:
name: Set $DOCKER_TAG
command: echo 'export DOCKER_TAG=${CIRCLE_TAG:-$CIRCLE_BRANCH}' >> $BASH_ENV
- run:
name: Build docker image
command: yarn docker:build
- run:
name: When building a git tag, tag the image as latest
command: |
if [ ! -z $CIRCLE_TAG ]; then \
yarn docker:tag-latest \
; fi
- run:
name: Push docker image
command: yarn docker:push
npm-publish:
docker:
- image: circleci/node:14
steps:
- checkout
- run:
name: Install dependencies (commands below need lerna)
command: yarn install --frozen-lockfile
- run:
name: Login to npm
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Compile modules
command: yarn compile
- run:
name: Publish npm modules
command: yarn lerna publish from-git --yes
workflows:
version: 2
qa-docker-npm:
jobs:
- qa:
# Run for all branches and all tags
filters:
tags:
only: /.*/
- publish-website:
requires:
- qa
# Run for all branches and all tags
filters:
tags:
only: /.*/
- docker-build-push:
requires:
- qa
# Run for all branches and all tags
filters:
tags:
only: /.*/
- npm-publish:
requires:
- qa
# Run only for tags starting with a v, don't run for branches
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/