generated from aka2024/pull
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
35 lines (33 loc) · 731 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
stages:
- test
- deploy
test:
image: node:16
stage: test
before_script:
- npm i
script:
- npm test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
deploy_registry:
image: docker:latest
stage: deploy
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE || true
script:
- docker build --pull
--cache-from $CI_REGISTRY_IMAGE
--build-arg VCS_REF=$CI_COMMIT_SHORT_SHA
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
-t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
only:
- master