-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
cloudbuild.yaml
26 lines (24 loc) · 916 Bytes
/
cloudbuild.yaml
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
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:latest',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:$COMMIT_SHA',
"--cache-from", 'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:latest',
'--build-arg',
'BUILDKIT_INLINE_CACHE=1',
'.'
]
env: [DOCKER_BUILDKIT=1]
# Only tag "latest" when on master
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
# Only push "latest" tag when building on "master"
[ "$BRANCH_NAME" != "master" ] && exit 0
docker push us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:latest
images: [
'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:$COMMIT_SHA',
]