File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
21name : Deploy Lambda Service
32
43on :
54 push :
6- branches : [ master, main ]
5+ branches : [master, main]
76 workflow_dispatch :
87
98jobs :
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 \
You can’t perform that action at this time.
0 commit comments