Skip to content

Commit

Permalink
Ensure artifact registry has repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Dec 4, 2024
1 parent 1a9fe1e commit 5548d73
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/build_and_publish/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
steps:
# Create Artifact Registry repository if it doesn't exist
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args:
- '-c'
- |
if ! gcloud artifacts repositories describe ${_REPOSITORY_NAME} --location=${_REGION}; then
gcloud artifacts repositories create ${_REPOSITORY_NAME} \
--repository-format=docker \
--location=${_REGION} \
fi
# Build the Docker image
- name: 'gcr.io/cloud-builders/docker'
args: [
Expand Down Expand Up @@ -58,7 +69,7 @@ steps:

substitutions:
_REGION: 'us-central1' # Default region
_REPOSITORY_NAME: 'policyengine-us-data' # Your Artifact Registry repository name
_REPOSITORY_NAME: 'policyengine/policyengine-us-data' # Your Artifact Registry repository name
_IMAGE_NAME: 'build-and-publish' # Your image name
_TAG: 'latest' # Image tag
_JOB_NAME: 'build-and-publish-us-data' # Cloud Run job name
Expand Down

0 comments on commit 5548d73

Please sign in to comment.