-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
38 lines (33 loc) · 834 Bytes
/
.gitlab-ci.yml
File metadata and controls
38 lines (33 loc) · 834 Bytes
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
image: alpine:latest
variables:
stages:
- test
- build
- review
- staging
- canary
- production
- cleanup
test:
stage: test
image: node:22-alpine
script:
- npm ci
- npm test
only:
- branches
build:
stage: build
image: docker:git
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
script:
- docker build -t "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" --build-arg "APP_GITSLUG=$CI_COMMIT_SHA" .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
# - docker tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
# - docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
only:
- branches