steps:
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'us-west2-docker.pkg.dev/$PROJECT_ID/classcorder/${_IMAGE_NAME}', '--build-arg', 'PROJECT=$PROJECT_ID', '--build-arg', 'DATASET=${_DATASET_NAME}', '--build-arg', 'BUCKET=${_BUCKET_NAME}', '--build-arg', 'GAI_API_KEY=${_GAI_API_KEY}', '.']
- name: 'gcr.io/cloud-builders/docker'
  args: ['push', 'us-west2-docker.pkg.dev/$PROJECT_ID/classcorder/${_IMAGE_NAME}']
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['run', 'deploy', 'classcorder', '--image', 'us-west2-docker.pkg.dev/$PROJECT_ID/classcorder/${_IMAGE_NAME}','--region', 'us-west2', '--allow-unauthenticated', '--port', '8501']
substitutions:
  _IMAGE_NAME: classcorder_app # default value
  _DATASET_NAME: classcorder
  _BUCKET_NAME: substitute_me
  _GAI_API_KEY: substitute_me
