Skip to content

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

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

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

Workflow file for this run

name: CICD
on:
push:
branches:
- ocean-spark
pull_request:
branches:
- ocean-spark
permissions:
contents: read
pull-requests: read
id-token: write
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-go
- name: Run gofmt check
run: make fmt-check
- name: Run static analysis
run: make static-analysis
- name: Run unit tests
run: make unit-test
cd-dev:
needs: [ci]
runs-on: ubuntu-latest
environment: dev
steps:
- if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v3
- if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: release to dev
uses: ./.github/actions/release
with:
aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
public-registry-id: n8e8v3t5
cd-prod:
if: ${{ github.event_name != 'pull_request' }}
needs: [cd-dev]
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
- name: release to prod
uses: ./.github/actions/release
with:
aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
public-registry-id: f4k1p1n4