Skip to content

Add intentionally randomly slow (finding nth prime) Python app and Gi… #2

Add intentionally randomly slow (finding nth prime) Python app and Gi…

Add intentionally randomly slow (finding nth prime) Python app and Gi… #2

name: Deploy to Amazon ECS
on:
push:
branches:
- main
paths:
- 'apps/prime-generator-python/**'
- '.github/workflows/**'
env:
ECR_REPOSITORY: prime-generator-python
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: dev
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws_actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GithubActionsAWS
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
working-directory: apps/prime-generator-python
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker tag
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT