Deploy fastAPI app as reverse proxy image to ECR by dkimds #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |