Skip to content

Commit b7fe96a

Browse files
committed
Update Docker build context in deployment workflow
- Changed the working directory for the Docker build command to the root of the repository, ensuring that all necessary files are included during the image build process. - Adjusted the command to create the ECR repository to ensure it is correctly formatted, enhancing the reliability of the deployment workflow.
1 parent aad14d8 commit b7fe96a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/deploy-backend.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,19 @@ jobs:
8787
env:
8888
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
8989
SUB_ENVIRONMENT: ${{ env.SUB_ENVIRONMENT }}
90+
working-directory: lambdas
9091
run: |
9192
IMAGE_TAG="${GITHUB_SHA}"
9293
REPOSITORY_NAME="imms-${SUB_ENVIRONMENT}-processing-repo"
9394
9495
if ! aws ecr describe-repositories --repository-names "${REPOSITORY_NAME}" --region "${AWS_REGION}" >/dev/null 2>&1; then
9596
echo "ECR repository ${REPOSITORY_NAME} does not exist; creating now..."
96-
aws ecr.create-repository --repository-name "${REPOSITORY_NAME}" --region "${AWS_REGION}"
97+
aws ecr create-repository --repository-name "${REPOSITORY_NAME}" --region "${AWS_REGION}"
9798
fi
9899
99100
IMAGE_URI="${ECR_REGISTRY}/${REPOSITORY_NAME}:${IMAGE_TAG}"
100101
101-
docker build -f recordprocessor/Dockerfile -t "${IMAGE_URI}" lambdas
102+
docker build -f recordprocessor/Dockerfile -t "${IMAGE_URI}" .
102103
docker push "${IMAGE_URI}"
103104
104105
echo "image_tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)