diff --git a/.gcloudignore b/.gcloudignore new file mode 100644 index 0000000000000000000000000000000000000000..69baf4bf98d6f1669345ba46491862a15165690d --- /dev/null +++ b/.gcloudignore @@ -0,0 +1,5 @@ +# Exclude node_modules +node_modules/ + +# Include dist directory +!dist/ \ No newline at end of file diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 7be1f8701c60d7831f58ba44180f841f854078b0..517f1422b79b2796233d4efdcc7bb5f40ce96138 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -11,7 +11,11 @@ steps: # Build the container image - name: 'gcr.io/cloud-builders/docker' - args: ['build', '-t', 'gcr.io/$PROJECT_ID/cloud-build-app:$SHORT_SHA', '.'] + args: ['build', '-t', 'asia-east1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/cloud-build-app:latest', '.'] + + # Push the container image to Artifact Registry + - name: 'gcr.io/cloud-builders/docker' + args: ['push', 'asia-east1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/cloud-build-app:latest'] # Deploy to Cloud Run - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' @@ -21,7 +25,7 @@ steps: - 'deploy' - 'cloud-build-app' - '--image' - - 'gcr.io/$PROJECT_ID/cloud-build-app:$SHORT_SHA' + - 'asia-east1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/cloud-build-app:latest' - '--region' - 'asia-east1' - '--platform' @@ -29,7 +33,7 @@ steps: - '--allow-unauthenticated' images: - - 'gcr.io/$PROJECT_ID/cloud-build-app:$SHORT_SHA' + - 'asia-east1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/cloud-build-app:latest' options: logging: CLOUD_LOGGING_ONLY \ No newline at end of file