Skip to content

Commit 5b22b91

Browse files
committed
fix: should work
1 parent d43ad23 commit 5b22b91

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
21
name: Deploy Lambda Service
32

43
on:
54
push:
6-
branches: [ master, main ]
5+
branches: [master, main]
76
workflow_dispatch:
87

98
jobs:
109
deploy:
11-
1210
runs-on: ubuntu-latest
1311

1412
permissions:
1513
deployments: write
16-
1714
steps:
1815
- name: Checkout code
1916
uses: actions/checkout@v3
@@ -42,19 +39,22 @@ jobs:
4239
echo "image_uri_latest=$IMAGE_TAG_LATEST" >> $GITHUB_OUTPUT
4340
echo "ecr_repository=$ECR_REPOSITORY" >> $GITHUB_OUTPUT
4441
42+
- name: Create ECR Repository (if it doesn't exist)
43+
run: |
44+
aws ecr describe-repositories --repository-names ${{ steps.set-image-uris.outputs.ecr_repository }} --region ${{ vars.AWS_REGION }} || aws ecr create-repository --repository-name ${{ steps.set-image-uris.outputs.ecr_repository }} --region ${{ vars.AWS_REGION }}
45+
4546
- name: Build Docker image
4647
id: build-image-and-push-to-ecr
4748
run: |
4849
docker buildx build --platform linux/arm64 -t ${{ vars.LAMBDA_FUNCTION_NAME }} --file Dockerfile.lambda .
49-
docker tag ${{ vars.LAMBDA_FUNCTION_NAME }}:latest r{{ steps.set-image-uris.outputs.image_uri_latest }}
50+
docker tag ${{ vars.LAMBDA_FUNCTION_NAME }}:latest ${{ steps.set-image-uris.outputs.image_uri_latest }}
5051
5152
- name: Push Docker image
5253
id: push-docker-image
53-
run: |
54+
run: |
5455
echo "Pushing ${{ steps.set-image-uris.outputs.image_uri_latest }}"
5556
docker push ${{ steps.set-image-uris.outputs.image_uri_latest }}
5657
57-
5858
- name: Update Lambda function
5959
run: |
6060
aws lambda update-function-code \

0 commit comments

Comments
 (0)