Skip to content

1.4.2

1.4.2 #2

Workflow file for this run

name: AWS ECR ETL
on:
push:
tags:
- '*'
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::${{secrets.AWS_ACCOUNT_ID}}:role/Github-ECR-Builder
role-session-name: GithubECRBuilder
aws-region: ${{secrets.AWS_REGION}}
- name: Docker Build ETL
run: docker build -t etl .
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker Tag ETL
run: docker tag etl ${{secrets.AWS_ACCOUNT_ID}}.dkr.ecr.${{secrets.AWS_REGION}}.amazonaws.com/coe-ecr-etl-tasks:${{github.event.repository.name}}-${{steps.tag.outputs.tag}}
- name: Docker Push ETL
run: docker push ${{secrets.AWS_ACCOUNT_ID}}.dkr.ecr.${{secrets.AWS_REGION}}.amazonaws.com/coe-ecr-etl-tasks:${{github.event.repository.name}}-${{steps.tag.outputs.tag}}
- name: Configure AWS Credentials (STAGING)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{secrets.AWS_STAGING_ACCOUNT_ID}}:role/Github-ECR-Builder
role-session-name: GithubECRBuilder
aws-region: ${{secrets.AWS_STAGING_REGION}}
- name: Login to Amazon ECR (STAGING)
id: login-ecr-staging
uses: aws-actions/amazon-ecr-login@v2
- name: Docker Tag ETL (STAGING)
run: docker tag etl ${{secrets.AWS_STAGING_ACCOUNT_ID}}.dkr.ecr.${{secrets.AWS_STAGING_REGION}}.amazonaws.com/coe-ecr-etl-tasks:${{github.event.repository.name}}-${{steps.tag.outputs.tag}}
- name: Docker Push ETL (STAGING)
run: docker push ${{secrets.AWS_STAGING_ACCOUNT_ID}}.dkr.ecr.${{secrets.AWS_STAGING_REGION}}.amazonaws.com/coe-ecr-etl-tasks:${{github.event.repository.name}}-${{steps.tag.outputs.tag}}