only keep most recent ECR image for costs #371
This file contains 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: Lambda Trigger DEV CICD Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Zip functions | |
run: | | |
cd modules/lambda_functions | |
zip -r bgg_scraper_fargate_trigger.zip bgg_scraper_fargate_trigger.py ../../config.py ../../utils | |
zip -r bgg_game_data_cleaner_fargate_trigger.zip bgg_game_data_cleaner_fargate_trigger.py ../../config.py ../../utils | |
zip -r generate_game_urls_lambda.zip generate_game_urls_lambda.py ../../config.py ../../utils | |
zip -r generate_user_urls_lambda.zip generate_user_urls_lambda.py ../../config.py ../../utils | |
zip -r generate_ratings_urls_lambda.zip generate_ratings_urls_lambda.py ../../config.py ../../utils | |
zip -r bgg_orchestrator_fargate_trigger.zip bgg_orchestrator_fargate_trigger.py ../../config.py ../../utils | |
zip -r bgg_ratings_data_cleaner_fargate_trigger.zip bgg_ratings_data_cleaner_fargate_trigger.py ../../config.py ../../utils | |
zip -r rag_description_generation_fargate_trigger.zip rag_description_generation_fargate_trigger.py ../../config.py ../../utils | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_GITHUB_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Post Lambda Functions | |
run: | | |
cd modules/lambda_functions | |
aws lambda update-function-code --function-name=dev_bgg_scraper_fargate_trigger --zip-file=fileb://bgg_scraper_fargate_trigger.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_game_data_cleaner_fargate_trigger --zip-file=fileb://bgg_game_data_cleaner_fargate_trigger.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_generate_game_urls --zip-file=fileb://generate_game_urls_lambda.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_generate_user_urls --zip-file=fileb://generate_user_urls_lambda.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_generate_ratings_urls --zip-file=fileb://generate_ratings_urls_lambda.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_orchestrator_fargate_trigger --zip-file=fileb://bgg_orchestrator_fargate_trigger.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_bgg_ratings_data_cleaner_fargate_trigger --zip-file=fileb://bgg_ratings_data_cleaner_fargate_trigger.zip > /dev/null 2>&1 | |
aws lambda update-function-code --function-name=dev_rag_description_generation_fargate_trigger --zip-file=fileb://rag_description_generation_fargate_trigger.zip > /dev/null 2>&1 | |