Skip to content

Commit

Permalink
Upload to ECR
Browse files Browse the repository at this point in the history
  • Loading branch information
logand22 committed Dec 11, 2023
1 parent 8f36617 commit 460df65
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ jobs:
name: Build and push Docker image
env:
AWS_REGION: us-west-2
AWS_ROLE: TBD
AWS_ROLE: arn:aws:iam::146628656107:role/cloud-github-action-ecr-role
steps:
- name: checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: setup docker buildx
uses: docker/setup-buildx-action@v2
- name: build docker image
Expand All @@ -49,8 +44,12 @@ jobs:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE }}
- name: login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@2fc7aceee09e9e4a7105c0d060c656fad0b4f63d # v1
- name: export ECR Repository
run: |
echo "ECR_REPOSITORY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
- name: push docker image
run: |
docker tag gravitational/aws-quota-checker:staged gravitational/aws-quota-checker:${GITHUB_REF##*/}
docker push gravitational/aws-quota-checker:${GITHUB_REF##*/}
docker tag gravitational/aws-quota-checker:staged ${ECR_REPOSITORY}/gravitational/aws-quota-checker:${GITHUB_REF##*/}
docker push ${ECR_REPOSITORY}/gravitational/aws-quota-checker:${GITHUB_REF##*/}

0 comments on commit 460df65

Please sign in to comment.