Merge pull request #9 from CERTCC/copilot/fix-build-containers-aws-de… #18
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: Build and Push Containers | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Assume STS role | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ vars.ARN }} | |
| aws-region: us-east-1 | |
| role-session-name: github-actions | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Build and push fastapi container | |
| run: | | |
| docker build -f Dockerfile-fa.yml -t ${{ steps.login-ecr.outputs.registry }}/fastapi:${{ github.sha }} . | |
| docker push ${{ steps.login-ecr.outputs.registry }}/fastapi:${{ github.sha }} | |
| - name: Build and push streamlit container | |
| run: | | |
| docker build -f Dockerfile-sl.yml -t ${{ steps.login-ecr.outputs.registry }}/streamlit:${{ github.sha }} . | |
| docker push ${{ steps.login-ecr.outputs.registry }}/streamlit:${{ github.sha }} |