amazon-ecr-login icon indicating copy to clipboard operation
amazon-ecr-login copied to clipboard

Possible to just use and deploy containers for my github aciton environment from aws (NOT TO PUSH, IF NOT PULL)

Open alanredmaiar opened this issue 2 years ago • 1 comments

Hi community!

I would like to ask for a feature (or in case of me missing this feature please help me to see how to proceed), when deploying actions in github CI.

Basically I dont find any info about how to pull containers from aws and deploy them in CI github actions during the job execution

jobs:
      backend-job:
            name: CI backend Integration env
            runs-on: ubuntu-latest
            services:
                  postgres:
                        image: postgres:10
                        ports:
                              - 5432:5432
                  rabbitmq:
                        image: rabbitmq
                        ports:
                              - 5672:5672
                  redis:
                        image: redis:alpine
                        ports:
                              - 6379:6379
            steps:
                  - name: Step 1
                    uses: ...
                  - name: Step 2
                    uses: ...

and add own docker-based app containers (from aws, google, heroku... whatever) passing credentials like:

...

            services:
            
                .....
                
                   some-aws-service:
                        image: XXXXXXXXX.YYY.ecr.eu-west-1.amazonaws.com/<AWS OWN SERVICE>:latest
                        ports:
                              - 5000:5000
                         credentials:
                             username: ${{ secrets.AWS_ACCESS_KEY_ID }}
                             password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Following multiple approaches like proposed (here:)[https://docs.github.com/es/actions/using-jobs/running-jobs-in-a-container]

But I receive this:

image

I also added these (steps)[https://github.com/aws-actions/amazon-ecr-login] at the begining:

- name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
        aws-region: us-east-1

    - name: Login to Amazon ECR Private
      id: login-ecr
      uses: aws-actions/amazon-ecr-login@v1

...

But nothing was possible...

Can you shed more light on this please?

Many thanks in advance!!!!

alanredmaiar avatar Jul 01 '22 10:07 alanredmaiar

Hey @TatanParker, to use the 'service' feature on GitHub Actions, the username and password must be the username and password must be Docker credentials. You can find how to access these Docker credentials from this action in the 'Docker Credentials' section of the README.

arjraman avatar Aug 05 '22 18:08 arjraman