File tree 5 files changed +96
-1
lines changed
5 files changed +96
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : container build
2
+ on :
3
+ push :
4
+ tags :
5
+ - ' **'
6
+ branches :
7
+ - ' **'
8
+ - ' !master'
9
+ schedule :
10
+ - cron : ' 0 0 * * *'
11
+ jobs :
12
+ container-build :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : checkout
16
+ uses : actions/checkout@v3
17
+ - name : Set up QEMU
18
+ uses : docker/setup-qemu-action@v3
19
+ - name : Set up Docker Buildx
20
+ uses : docker/setup-buildx-action@v2
21
+ - name : Log into registry
22
+ uses : docker/login-action@v3
23
+ with :
24
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
25
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
26
+ - name : Docker meta
27
+ id : meta
28
+ uses : docker/metadata-action@v5
29
+ with :
30
+ images : commitlint/commitlint
31
+ tags : |
32
+ type=semver,pattern={{version}}
33
+ type=edge,branch=master
34
+ type=ref,event=branch
35
+ type=sha,prefix=,format=short
36
+ - name : Build and push container image
37
+ uses : docker/build-push-action@v5
38
+ with :
39
+ context : .
40
+ file : Dockerfile.ci
41
+ push : true
42
+ tags : ${{ steps.meta.outputs.tags }}
43
+ labels : ${{ steps.meta.outputs.labels }}
44
+ # disable arm build for now, because of https://github.com/nodejs/docker-node/issues/1335
45
+ platforms : linux/amd64 # ,linux/arm64
Original file line number Diff line number Diff line change
1
+ FROM docker.io/library/node:18-buster AS builder
2
+ WORKDIR /src
3
+ COPY . ./
4
+ RUN yarn install && \
5
+ yarn run build && \
6
+ # Commit lint CLI packages
7
+ npm pack @commitlint/cli && \
8
+ npm pack @commitlint/config-validator && \
9
+ npm pack @commitlint/ensure && \
10
+ npm pack @commitlint/execute-rule && \
11
+ npm pack @commitlint/format && \
12
+ npm pack @commitlint/is-ignored && \
13
+ npm pack @commitlint/lint && \
14
+ npm pack @commitlint/load && \
15
+ npm pack @commitlint/message && \
16
+ npm pack @commitlint/parse && \
17
+ npm pack @commitlint/read && \
18
+ npm pack @commitlint/resolve-extends && \
19
+ npm pack @commitlint/rules && \
20
+ npm pack @commitlint/to-lines && \
21
+ npm pack @commitlint/top-level && \
22
+ npm pack @commitlint/types && \
23
+ # Default commitlint config
24
+ npm pack @commitlint/config-conventional
25
+
26
+ FROM docker.io/library/node:18-buster
27
+ COPY --from=builder /src/*.tgz ./
28
+ RUN npm install -g *.tgz && \
29
+ rm -rf *.tgz
30
+ ENTRYPOINT ["commitlint"]
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
version : ' 3'
2
2
services :
3
3
commitlint :
4
- build : .
4
+ build :
5
+ context : .
6
+ dockerfile : Dockerfile.dev
5
7
image : marionebl/commitlint-cubicle
6
8
ports :
7
9
- ' 8443:8443'
Original file line number Diff line number Diff line change @@ -121,12 +121,30 @@ workflows:
121
121
## GitLab CI
122
122
123
123
` ` ` yaml
124
+ stages : ["lint","build","test"]
124
125
lint:commit :
126
+ image : registry.hub.docker.com/library/node:alpine
125
127
stage : lint
128
+ before_script :
129
+ - apk add --no-cache git
130
+ - npm install --save-dev @commitlint/config-conventional @commitlint/cli
126
131
script :
127
132
- echo "${CI_COMMIT_MESSAGE}" | npx commitlint
128
133
` ` `
129
134
135
+ ## GitLab CI with pre-build container
136
+
137
+ ` ` ` yaml
138
+ stages : ["lint","build","test"]
139
+ lint:commit :
140
+ image :
141
+ name : registry.hub.docker.com/commitlint/commitlint:latest
142
+ entrypoint : [""]
143
+ stage : lint
144
+ script :
145
+ - echo "${CI_COMMIT_MESSAGE}" | commitlint
146
+ ` ` `
147
+
130
148
### 3rd party integrations
131
149
132
150
#### [Codemagic](https://codemagic.io/)
You can’t perform that action at this time.
0 commit comments