Skip to content

Commit

Permalink
Update AWS credentials action to version 3 and modify Docker image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
MarchTs committed Sep 20, 2024
1 parent faa1f0b commit 9827dce
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/example-build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Build and Push Docker Image to ECR
on:
push:
branches:
- example/pipeline # or specify any branch you want to trigger this workflow on
- example/pipeline-march # or specify any branch you want to trigger this workflow on

permissions:
id-token: write
contents: read

jobs:
build-and-push:
Expand All @@ -19,27 +23,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Configure AWS credentials with session token
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} # Use the session token
aws-region: us-east-1 # Change to your AWS region

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::697698820969:role/GithubActionAssumeRole
aws-region: us-east-1



- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push Docker image
env:
ECR_URI: "778529894665.dkr.ecr.us-east-1.amazonaws.com/web-app"
ECR_URI: "697698820969.dkr.ecr.us-east-1.amazonaws.com/web-app"
IMAGE_TAG: latest-march
run: |
yarn --frozen-lockfile
Expand Down

0 comments on commit 9827dce

Please sign in to comment.