steps:
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'asia-northeast1-docker.pkg.dev/$PROJECT_ID/app-repo/spring-gs:v1', '.']

- name: 'gcr.io/cloud-builders/docker'
  args: ['push', 'asia-northeast1-docker.pkg.dev/$PROJECT_ID/app-repo/spring-gs:v1']

- name: 'gcr.io/cloud-builders/gcloud'
  entrypoint: 'bash'
  args:
    - '-c'
    - |
      sed -i "s|image: .*|image: asia-northeast1-docker.pkg.dev/$PROJECT_ID/app-repo/spring-gs:v1|g" kubernetes-manifests/deployment.yaml

- name: "gcr.io/cloud-builders/gke-deploy"
  args:
  - run
  - --filename=kubernetes-manifests/
  - --image=asia-northeast1-docker.pkg.dev/$PROJECT_ID/app-repo/spring-gs:v1
  - --location=asia-northeast1
  - --cluster=dev-cluster