Skip to content

Deploy fastAPI app as reverse proxy image to ECR by dkimds #11

Deploy fastAPI app as reverse proxy image to ECR by dkimds

Deploy fastAPI app as reverse proxy image to ECR by dkimds #11

Workflow file for this run

name: Deploy fastAPI app
run-name: Deploy fastAPI app as reverse proxy image to ECR by ${{github.actor}}
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
run: |
docker build -t ${{secrets.AWS_ORGANIZATION}}/ai .
docker tag ${{secrets.AWS_ORGANIZATION}}/ai:latest ${{ secrets.AWS_ECR_AI_REPO }}:latest
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Push image to ECR
run: |
docker push ${{ secrets.AWS_ECR_AI_REPO }}:latest