added github sha to docker tag

This commit is contained in:
Khalim Conn-Kowlessar 2023-08-23 08:20:37 +01:00
parent 96ac0135e9
commit 238bea1f39

View file

@ -69,7 +69,7 @@ jobs:
- name: Build Docker Image
run: |
docker build -t my-lambda-image:latest -f backend/docker/lambda.Dockerfile .
docker build -t fastapi-lambda-image:${{ github.sha }} -f backend/docker/lambda.Dockerfile .
- name: Login to ECR
run: |
@ -77,8 +77,8 @@ jobs:
- name: Tag and Push Docker Image to ECR
run: |
docker tag my-lambda-image:latest ${{ steps.set_ecr_credentials.outputs.ecr_uri }}:latest
docker push ${{ steps.set_ecr_credentials.outputs.ecr_uri }}:latest
docker tag fastapi-lambda-image:${{ github.sha }} ${{ steps.set_ecr_credentials.outputs.ecr_uri }}:${{ github.sha }}
docker push ${{ steps.set_ecr_credentials.outputs.ecr_uri }}:${{ github.sha }}
- name: Deploy to AWS Lambda via Serverless
env: