Skip to content

Commit

Permalink
deploy with cloud build
Browse files Browse the repository at this point in the history
  • Loading branch information
sfujiwara committed Apr 23, 2024
1 parent 6eeee65 commit 838254f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2

- uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/609385848802/locations/global/workloadIdentityPools/github/providers/github
service_account: [email protected]

- run: gcloud storage ls gs://sfujiwara-terraform
- name: Deploy
run: make cloud-build
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ cloud-run-deploy:
--image $(DOCKER_IMAGE) \
sfujiwara

cloud-build:
gcloud builds submit --project $(PROJECT) --region=us-central1

terraform-plan:
cd terraform && terraform plan

Expand Down
13 changes: 13 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'us-central1-docker.pkg.dev/sfujiwara/docker/sfujiwara', '.']

- name: gcr.io/cloud-builders/docker
args: ['push', 'us-central1-docker.pkg.dev/sfujiwara/docker/sfujiwara']

- name: gcr.io/google.com/cloudsdktool/cloud-sdk
entrypoint: gcloud
args: ['run', 'deploy', 'sfujiwara', '--image', 'us-central1-docker.pkg.dev/sfujiwara/docker/sfujiwara', '--region', 'us-central1']

images:
- us-central1-docker.pkg.dev/sfujiwara/docker/sfujiwara

0 comments on commit 838254f

Please sign in to comment.