From e8611709b9dd98deb61e9202e0c16e497f85131d Mon Sep 17 00:00:00 2001 From: Tim Myers Date: Fri, 10 Feb 2023 18:08:38 -0700 Subject: [PATCH] fix: push image to ECR (#31) Co-authored-by: Aaron Batilo --- .github/workflows/release.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cccf2e..c0205e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,7 @@ permissions: issues: write pull-requests: write packages: write + id-token: write env: SEMANTIC_VERSION: 19 @@ -43,13 +44,28 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: aws-actions/configure-aws-credentials@v1-node16 + with: + role-to-assume: ${{ secrets.AWS_DEV_GITHUB_ROLE }} + aws-region: us-east-1 + - uses: aws-actions/configure-aws-credentials@v1-node16 + with: + role-to-assume: ${{ secrets.AWS_DEV_INFRA_ROLE }} + aws-region: us-east-1 + aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }} + aws-session-token: ${{ env.AWS_SESSION_TOKEN }} + role-skip-session-tagging: true + - uses: aws-actions/amazon-ecr-login@v1 + with: + registry-type: public - name: Build docker image if: steps.semantic.outputs.new_release_version != '' uses: docker/build-push-action@v3 with: context: . file: Dockerfile - tags: ghcr.io/infura/infrakit:${{ steps.semantic.outputs.new_release_version }} + tags: ghcr.io/infura/infrakit:${{ steps.semantic.outputs.new_release_version }},public.ecr.aws/s5k1g2u8/infrakit:${{ steps.semantic.outputs.new_release_version }} push: true platforms: linux/amd64,linux/arm64 cache-from: type=gha @@ -60,4 +76,4 @@ jobs: with: semantic_version: ${{ env.SEMANTIC_VERSION }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}