Skip to content

GitHub action to login to Amazon ECR

Notifications You must be signed in to change notification settings

cialfo/gh-ecr-login

 
 

Repository files navigation

Login to Amazon ECR Action

See also Push to Amazon ECR Action.

Setup

To set this up, create a new IAM user with access to ECR (e.g. with the AmazonEC2ContainerRegistryFullAccess policy). Then, add the following secrets to your GitHub project:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

Usage

- name: Login to ECR
  id: ecr
  uses: jwalton/gh-ecr-login@v1
  with:
    access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    region: us-east-1
- name: Push to ECR
  run: |
    docker tag my-image ${{ steps.ecr.outputs.account }}.dkr.ecr.us-east-1.amazonaws.com/my-image:v1
    docker push ${{ steps.ecr.outputs.account }}.dkr.ecr.us-east-1.amazonaws.com/my-image:v1

About

GitHub action to login to Amazon ECR

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%