src/application/ui/cloudbuild.yaml (24 lines of code) (raw):
#
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--build-arg', 'REACT_APP_API_URL=${_REACT_APP_API_URL}',
'--build-arg', 'REACT_APP_GEN_AI_URL=${_REACT_APP_GEN_AI_URL}',
'-t', '${_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest',
'.'
]
# Push the container image to Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: [
'push',
'${_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest'
]
images:
- '${_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest'
options:
logging: CLOUD_LOGGING_ONLY
substitutions:
_REACT_APP_API_URL: 'http://localhost:8080' # Default value, will be overridden
_REACT_APP_GEN_AI_URL: 'http://localhost:8081' # Default value, will be overridden
_LOCATION: 'us-central1' # Default value, will be overridden
_REPOSITORY: 'psearch-ui-repo' # Default value, will be overridden
_IMAGE_NAME: 'psearch-ui' # Default value, will be overridden