Skip to content

Commit

Permalink
feat(action-aws): ecr public login
Browse files Browse the repository at this point in the history
  • Loading branch information
JoffreyPlouvier committed Jul 19, 2023
1 parent e842146 commit df5a80c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
28 changes: 28 additions & 0 deletions actions/aws/ecr-public-login/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# AWS: ecr-public-login

## Behavior

Login on the public AWS ECR registry.

## Usage

```yaml
jobs:
ecrPublicLogin:
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: "actions/checkout@v3"

- name: "ECR public login"
uses: "meero-com/github-actions-shared-workflows/actions/aws/ecr-public-login@main"
with:
AWS_ACCESS_KEY_ID: ${{ secrets.NP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NP_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
```
Beware of using a `@ref` (`@main` in the example above) which suits your stability requirements in your workflow:

* Use `@main` if you always want to use the latest version of the workflow.
* Use `@<tag>` if you wan to use a specific frozen version of the workflow.
29 changes: 29 additions & 0 deletions actions/aws/ecr-public-login/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "ECR public login"
description: "Login on the public AWS ECR registry"

inputs:
AWS_ACCESS_KEY_ID:
description: "Aws access key"
required: true
AWS_SECRET_ACCESS_KEY:
description: "AWS secret"
required: true
AWS_REGION:
description: "AWS region"
required: true

runs:
using: "composite"
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ inputs.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ inputs.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public

0 comments on commit df5a80c

Please sign in to comment.