Skip to content

Commit 599b6ff

Browse files
committed
Fix Docker buildx command - add build context
1 parent 9c58f2a commit 599b6ff

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
78

89
jobs:
910
deploy:
@@ -24,15 +25,24 @@ jobs:
2425
id: login-ecr
2526
uses: aws-actions/amazon-ecr-login@v2
2627

28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
2731
- name: Build and push Docker image
2832
env:
2933
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
3034
ECR_REPOSITORY: ${{ secrets.ECR_REPO }}
35+
IMAGE_TAG: ${{ github.sha }}
3136
run: |
32-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
33-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
37+
docker buildx build \
38+
--platform linux/amd64 \
39+
-t $ECR_REGISTRY/$ECR_REPOSITORY:latest \
40+
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
41+
--push \
42+
.
3443
3544
- name: Deploy to EKS
3645
run: |
3746
aws eks update-kubeconfig --name ${{ secrets.EKS_CLUSTER }} --region ${{ secrets.AWS_REGION }}
3847
kubectl rollout restart deployment fastapi -n fastapi
48+
kubectl rollout status deployment fastapi -n fastapi --timeout=5m

0 commit comments

Comments
 (0)