diff --git a/ecr/login/action.yaml b/ecr/login/action.yaml new file mode 100644 index 0000000..b1431b9 --- /dev/null +++ b/ecr/login/action.yaml @@ -0,0 +1,39 @@ +name: Login to ECR +description: Login to ECR +branding: + color: orange + icon: corner-right-up +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 + required: false + +outputs: + registry: + value: ${{ steps.ecr.outputs.registry }} + description: ECR host + +runs: + using: composite + steps: + - + name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ inputs.role-to-assume }} + role-session-name: ${{ inputs.role-session-name }} + aws-region: ${{ inputs.aws-region }} + - + name: Login to Amazon ECR + id: ecr + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: true + diff --git a/ecr/push/action.yaml b/ecr/push/action.yaml index 666c64a..e2bb45f 100644 --- a/ecr/push/action.yaml +++ b/ecr/push/action.yaml @@ -27,18 +27,13 @@ runs: using: composite steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + name: Login to ECR + uses: comet-ml/gha-actions/ecr/login@main + id: ecr with: role-to-assume: ${{ inputs.role-to-assume }} role-session-name: ${{ inputs.role-session-name }} aws-region: ${{ inputs.aws-region }} - - - name: Login to Amazon ECR - id: ecr - uses: aws-actions/amazon-ecr-login@v2 - with: - mask-password: true - name: Set tags and push shell: bash