Skip to content

Commit e1cef19

Browse files
committed
chore: update ECR push workflow
1 parent c190462 commit e1cef19

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/temp-aws-push-test.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
- name: Login to Amazon ECR
4343
id: login-ecr
4444
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
45+
with:
46+
registries: "772954894450"
4547

4648
- name: Extract metadata (tags, labels) for Docker
4749
id: meta
@@ -52,18 +54,16 @@ jobs:
5254
latest
5355
${{ env.COMMIT_SHA }}
5456
55-
- name: Build and push Docker image to Amazon ECR
56-
id: push-ecr
57-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
58-
with:
59-
context: ./user-management
60-
file: ./user-management/src/Stickerlandia.UserManagement.Api/Dockerfile
61-
platforms: linux/amd64,linux/arm64
62-
push: true
63-
tags: ${{ steps.meta.outputs.tags }}
64-
labels: ${{ steps.meta.outputs.labels }}
65-
build-args: |
66-
GIT_COMMIT_SHA=${{ env.COMMIT_SHA }}
67-
GIT_REPOSITORY_URL=${{ env.ECR_REPOSITORY_URL }}
68-
DD_GIT_REPOSITORY_URL=${{ env.ECR_REPOSITORY_URL }}
69-
DD_GIT_COMMIT_SHA=${{ env.COMMIT_SHA }}
57+
- name: Build, tag, and push image to Amazon ECR
58+
id: build-publish
59+
shell: bash
60+
env:
61+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
62+
ECR_REPOSITORY: ${{ env.IMAGE_NAME_USER_SERVICE }}
63+
IMAGE_TAG: "latest"
64+
run: |
65+
docker build "./user-management" -f "/user-management/src/Stickerlandia.UserManagement.Api/Dockerfile" -t "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
66+
docker push "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
67+
echo "IMAGE $IMAGE_TAG is pushed to $ECR_REGISTRY/$ECR_REPOSITORY"
68+
echo "image_tag=$IMAGE_TAG"
69+
echo "full_image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"

0 commit comments

Comments
 (0)