-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
31 lines (28 loc) · 919 Bytes
/
.gitlab-ci.yml
File metadata and controls
31 lines (28 loc) · 919 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
stages:
- build-container
variables:
# Define the default image name and registry (adjust these to your needs)
DOCKER_IMAGE: gx4ki/workflow-api
DOCKER_REGISTRY: registry.example.com
build-workflow-api:
stage: build-container
image: docker:20.10.21-dind
before_script:
- docker version
- echo "$IMLA_CONTAINER_REGISTRY_PASS" | docker login $IMLA_CONTAINER_REGISTRY --username $IMLA_CONTAINER_REGISTRY_USER --password-stdin
script:
- if [[ "$CI_COMMIT_REF_NAME" == "main" ]]; then
TAG="${IMLA_CONTAINER_REGISTRY}/${DOCKER_IMAGE}:latest";
elif [[ "$CI_COMMIT_REF_NAME" == "dev" ]]; then
TAG="${IMLA_CONTAINER_REGISTRY}/${DOCKER_IMAGE}:dev";
else
TAG="${IMLA_CONTAINER_REGISTRY}/${DOCKER_IMAGE}:$CI_COMMIT_REF_NAME";
fi
- docker build --no-cache --pull -t ${TAG} .
- docker push ${TAG}
tags:
- imla
only:
refs:
- main
- dev