-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy path.gitlab-ci.yml
40 lines (32 loc) · 1.03 KB
/
.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
36
37
38
39
40
image: jdrouet/docker-with-buildx:stable
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
services:
- name: docker:19.03.12-dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
before_script:
- docker login -u $REGISTRY_USERNAME -p $USER_TOKEN $CI_REGISTRY
stages:
- build
bot:latest:
stage: build
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
script:
- |
docker buildx create --use
docker buildx build --platform "linux/amd64" --push -t "$CI_REGISTRY_IMAGE/amd64:latest" .
docker buildx build --platform "linux/arm64" --push -t "$CI_REGISTRY_IMAGE/arm64:latest" .
bot:tagged:
stage: build
rules:
- if: '$CI_COMMIT_TAG =~ /^v([0-9.]+)$/'
when: on_success
script:
- |
docker buildx create --use
docker buildx build --platform "linux/amd64" --push -t "$CI_REGISTRY_IMAGE/amd64:$CI_COMMIT_TAG" .
docker buildx build --platform "linux/arm64" --push -t "$CI_REGISTRY_IMAGE/arm64:$CI_COMMIT_TAG" .