Skip to content

Commit e0538c4

Browse files
committed
Refactor Docker image build process in deployment workflow
- Removed the `enable_recordprocessor` input from the continuous deployment workflow. - Added a conditional check in the backend deployment workflow to skip the Docker build and push if the image already exists in ECR, improving efficiency and reducing unnecessary builds.
1 parent b7fe96a commit e0538c4

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/continuous-deployment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
uses: ./.github/workflows/deploy-backend.yml
2121
with:
2222
apigee_environment: internal-dev
23-
enable_recordprocessor: true
2423
create_mns_subscription: true
2524
environment: dev
2625
sub_environment: internal-dev

.github/workflows/deploy-backend.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ jobs:
9999
100100
IMAGE_URI="${ECR_REGISTRY}/${REPOSITORY_NAME}:${IMAGE_TAG}"
101101
102-
docker build -f recordprocessor/Dockerfile -t "${IMAGE_URI}" .
103-
docker push "${IMAGE_URI}"
102+
if aws ecr describe-images --repository-name "${REPOSITORY_NAME}" --image-ids imageTag="${IMAGE_TAG}" --region "${AWS_REGION}" >/dev/null 2>&1; then
103+
echo "Image ${IMAGE_TAG} already exists in ECR, skipping build and push"
104+
else
105+
docker build -f recordprocessor/Dockerfile -t "${IMAGE_URI}" .
106+
docker push "${IMAGE_URI}"
107+
fi
104108
105109
echo "image_tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
106110

0 commit comments

Comments
 (0)