Skip to content

Commit

Permalink
feat: add Cloud Build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sattwyk committed Nov 5, 2024
1 parent a512d65 commit 6c81dee
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
steps:
# Build the Docker image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/discord-bot:$COMMIT_SHA'
- '-f'
- 'bot/Dockerfile'
- 'bot'
env:
- 'DOCKER_BUILDKIT=1'

# Push the image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/discord-bot:$COMMIT_SHA'

# Deploy to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'discord-bot'
- '--image'
- 'gcr.io/$PROJECT_ID/discord-bot:$COMMIT_SHA'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'

images:
- 'gcr.io/$PROJECT_ID/discord-bot:$COMMIT_SHA'

0 comments on commit 6c81dee

Please sign in to comment.