Skip to content

Commit

Permalink
add push to ecr
Browse files Browse the repository at this point in the history
  • Loading branch information
obezpalko committed Jun 5, 2024
1 parent 269f0d2 commit 484dd97
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions ecr/push/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Push ECR
description: Push to ECR
branding:
color: red
icon: upload
inputs:
role-to-assume:
description: role to access AWS
required: true
aws-region:
description: aws region
default: us-east-1
required: false
role-session-name:
description: AWS role session name
default: ${{ vars.ROLE_SESSION_NAME }}
required: false
image-name:
description: Image to push
required: true

outputs:
registry:
value: ${{ steps.ecr.outputs.registry }}
description: ECR host

runs:
using: composite
steps:
-
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ inputs.role-to-assume }}
aws-region: ${{ inputs.aws-region }}
-
name: Login to Amazon ECR
id: ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
-
name: Set tags and push
shell: bash
run: |
docker tag ${{ inputs.image-name }} ${{ steps.ecr.output.registry }}/${{ inputs.image-name }}

0 comments on commit 484dd97

Please sign in to comment.