-
Notifications
You must be signed in to change notification settings - Fork 90
/
cloudbuild.yml
36 lines (36 loc) · 1.08 KB
/
cloudbuild.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
steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login --username=$_HUB_REPO --password=$$PASSWORD']
secretEnv: ['PASSWORD']
- name: gcr.io/cloud-builders/docker
args:
- buildx
- create
- '--name'
- buildxbuilder
- '--use'
- '--bootstrap'
id: create-builder
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker pull docker.io/$_HUB_REPO/lilac:latest || exit 0']
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
[
'-c',
'docker buildx build --platform $_DOCKER_BUILDX_PLATFORMS -t $_HUB_REPO/lilac:latest -t
$_HUB_REPO/lilac:$_VERSION --cache-from docker.io/$_HUB_REPO/lilac:latest . --push'
]
options:
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
substitutions:
_PROJECT_ID: 'lilac-386213'
_DOCKER_BUILDX_PLATFORMS: 'linux/amd64,linux/arm64'
_HUB_REPO: 'lilacai'
availableSecrets:
secretManager:
- versionName: projects/$_PROJECT_ID/secrets/DOCKER_PASSWORD_SECRET_NAME/versions/1
env: 'PASSWORD'