Git Product home page Git Product logo

create-ecr-repository-action's Introduction

create-ecr-repository-action ts

This is a GitHub Action to create a repository into Amazon ECR or ECR Public registry if it does not exist. It can put a lifecycle policy to the repository for cost saving and a repository policy for cross account access.

Getting Started

To create a repository:

jobs:
  build:
    steps:
      - uses: int128/create-ecr-repository-action@v1
        with:
          repository: hello-world

If the repository exists, this action does nothing.

Put a lifecycle policy

To create a repository with a lifecycle policy:

      - uses: int128/create-ecr-repository-action@v1
        with:
          repository: hello-world
          lifecycle-policy: config/lifecycle-policy.json

If the repository exists, this action just puts the lifecycle policy.

Put a permission policy

To create a repository with a permission policy:

      - uses: int128/create-ecr-repository-action@v1
        with:
          repository: hello-world
          permission-policy: config/permission-policy.json

If the repository exists, this action just puts the permission policy.

Create into ECR Public

To create a repository into ECR Public registry:

      - uses: int128/create-ecr-repository-action@v1
        with:
          repository: hello-world
          public: true

If the repository exists, this action does nothing. Note that currently ECR Public does not support the lifecycle polocy.

Full example

Here is a full example to build an image and put it into an ECR repository:

jobs:
  build:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
      - uses: aws-actions/amazon-ecr-login@v1
      - uses: int128/create-ecr-repository-action@v1
        id: ecr
        with:
          repository: hello-world
      - run: docker build -t ${{ steps.ecr.outputs.repository-uri }}:latest .
      - run: docker push ${{ steps.ecr.outputs.repository-uri }}:latest

Use a release tag such as v1. Do not use main branch because it does not contain dist files.

Inputs

Name Default Description
public false Set true to create into ECR Public registry
repository (required) Repository name to create
lifecycle-policy - Path to a file of lifecycle policy for the repository
permission-policy Path to a file of permission policy for the repository (optional)

Outputs

Name Description
repository-uri URI of the repository (in form of ACCOUNT.dkr.ecr.REGION.amazonaws.com/NAME or public.ecr.aws/ID/NAME)

create-ecr-repository-action's People

Contributors

dependabot[bot] avatar int128 avatar jrvlima avatar renovate[bot] avatar sirbeep avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.