Skip to content

Merge pull request #18 from markreesmoj/PIC-4134-service-account-name… #14

Merge pull request #18 from markreesmoj/PIC-4134-service-account-name…

Merge pull request #18 from markreesmoj/PIC-4134-service-account-name… #14

Workflow file for this run

on:
push:
branches: [main]
jobs:
ecr:
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
steps:
# Checkout GitHub repository
- uses: actions/checkout@v4
# Assume role in Cloud Platform
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ECR_ROLE_TO_ASSUME }}
aws-region: ${{ vars.ECR_REGION }}
# Login to container repository
- uses: aws-actions/amazon-ecr-login@v2
id: login-ecr
# Build and push a Docker image to the container repository
- run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: ${{ vars.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}