amazon-ecr-login
amazon-ecr-login copied to clipboard
Compatibility with `docker/build-push-action`
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.
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.