Skip to content

Commit d428279

Browse files
committed
Push Docker to ECR
1 parent 33247ce commit d428279

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/main.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,18 @@ jobs:
4242

4343
- name: Login to Amazon ECR
4444
id: login-ecr
45-
uses: aws-actions/amazon-ecr-login@v1
45+
uses: aws-actions/amazon-ecr-login@v1
46+
47+
- name: Build, tag, and push image to Amazon ECR
48+
id: build-image
49+
env:
50+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
51+
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_NAME }}
52+
IMAGE_TAG: latest
53+
run: |
54+
# Build a docker container and
55+
# push it to ECR so that it can
56+
# be deployed to ECS.
57+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
58+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
59+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"

0 commit comments

Comments
 (0)