Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with docker/build-push-action #486

Open
gsuess opened this issue Aug 1, 2023 · 1 comment
Open

Compatibility with docker/build-push-action #486

gsuess opened this issue Aug 1, 2023 · 1 comment
Labels
feature-request A feature should be added or improved.

Comments

@gsuess
Copy link

gsuess commented Aug 1, 2023

Is aws-actions/amazon-ecr-login compatible with docker/build-push-action?

This should be documented in the readme. I am wondering if I can just have this:

- name: AWS Assume Role
  uses: aws-actions/configure-aws-credentials@v2
  with:
    role-to-assume: ${{ vars.AWS_OIDC_ACCESS_ROLE }}
    aws-region: eu-central-1

- name: Log in to the Container registry
  id: ecr-login
  uses: aws-actions/amazon-ecr-login@v1

- name: Docker meta
  id: meta
  uses: docker/metadata-action@v4
  with:
    images: ${{ steps.ecr-login.outputs.registry }}/${{ env.IMAGE_NAME }}

- name: Set up Docker Build
  uses: docker/setup-buildx-action@v2

- name: Build and push
   id: push
   uses: docker/build-push-action@v4
   with:
     push: true
     tags: ${{ steps.meta.outputs.tags }}
     labels: ${{ steps.meta.outputs.labels }}

I will go ahead and test it and report back here, but either I think it should documented or if its not compatible, perhaps it can be made compatible?

It would make transitioning container registry to ECR easier as less changes would be needed for existing workflows.

It would also allow reusability of workflows so that they deploy to multiple registries.

@gsuess gsuess added the feature-request A feature should be added or improved. label Aug 1, 2023
@gsuess
Copy link
Author

gsuess commented Aug 2, 2023

Okay turns out that the above works fine so the two actions are compatible with each other.

I believe this is a better approach the one currently documented on the Readme.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

1 participant