add s3 list bucket permissions #17
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: test and deploy | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Run tests | |
| run: uv run pytest tests | |
| build-validation-lambda-ecr: | |
| needs: test | |
| uses: heaven00/fraud-detection-aws/.github/workflows/build_and_deploy_images.yml@main | |
| with: | |
| aws-region: ca-central-1 | |
| ecr-repo-name: fraud-detection/validation-lambda | |
| image-tag: ${{ github.sha }} | |
| secrets: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| deploy-serverless-infra: | |
| needs: build-validation-lambda-ecr | |
| runs-on: ubuntu-latest | |
| env: | |
| aws-region: ca-central-1 | |
| commit-sha: ${{ github.sha }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.aws-region }} | |
| - name: Deploy to AWS CloudFormation | |
| uses: aws-actions/aws-cloudformation-github-deploy@v1 | |
| with: | |
| name: fraud-detection | |
| template: template.yaml | |
| parameter-overrides: "Environment=dev,Region=${{ env.aws-region }},ECRRepositoryTag=${{ env.commit-sha }}" | |
| capabilities: "CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND" | |
| disable-rollback: true # handle it manually and rollbacks are weird |