Skip to content

Commit

Permalink
feat(build): Add cloudbuild.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed May 30, 2024
1 parent 98ffeb6 commit 5df66d9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
[
'build',
'-t',
'us-central1-docker.pkg.dev/$PROJECT_ID/uptime-checker/image:latest',
'-t',
'us-central1-docker.pkg.dev/$PROJECT_ID/uptime-checker/image:$COMMIT_SHA',
'--build-arg',
'BUILDKIT_INLINE_CACHE=1',
'--cache-from',
'us-central1-docker.pkg.dev/$PROJECT_ID/uptime-checker/image:latest',
'.',
]
env: [DOCKER_BUILDKIT=1]

- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
# Only push "latest" tag when building on "main"
[ "$BRANCH_NAME" != "main" ] && exit 0
docker push us-central1-docker.pkg.dev/$PROJECT_ID/uptime-checker/image:latest
images: [
'us-central1-docker.pkg.dev/$PROJECT_ID/uptime-checker/image:$COMMIT_SHA',
]

0 comments on commit 5df66d9

Please sign in to comment.