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

[.github/workflows] update build/release workflow to use IRSA #33

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: 'Release Action'
description: 'Build and Push the application docker image'

inputs:
aws-access-key-id:
description: 'AWS Access Key ID'
required: true
aws-secret-access-key:
description: 'AWS Secret Access Key'
aws-role-to-assume:
description: 'AWS Role to Assume'
required: true
public-registry-id:
description: 'Public ECR Registry ID'
Expand All @@ -22,12 +19,17 @@ runs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ inputs.aws-role-to-assume }}
role-session-name: ${{ inputs.aws-role-session-name }}
aws-region: us-east-1

- name: Login to Amazon ECR
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ inputs.aws-access-key-id }}
password: ${{ inputs.aws-secret-access-key }}

- name: Build images
run: make -f .github/actions/release/Makefile build
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- ocean-spark


permissions:
contents: read
pull-requests: read
id-token: write

jobs:
ci:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -41,8 +46,8 @@ jobs:
- name: release to dev
uses: ./.github/actions/release
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
public-registry-id: n8e8v3t5

cd-prod:
Expand All @@ -56,6 +61,6 @@ jobs:
- name: release to prod
uses: ./.github/actions/release
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
public-registry-id: f4k1p1n4
Loading