Skip to content

Deploy axumed lambda (#161) #144

Deploy axumed lambda (#161)

Deploy axumed lambda (#161) #144

name: staging-deployment
on:
push:
branches:
- main
permissions:
# This is required for requesting the JWT.
id-token: write
# This is required for actions/checkout.
contents: read
concurrency: ${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo lambda
run: pip install cargo-lambda
# Configure AWS and deploy the lambdas.
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.LAMBDA_DEPLOY_GITHUB_ROLE_ARN_STAGING }}
aws-region: ${{ secrets.AWS_REGION_STAGING }}
# Build the lambdas in release mode and deploy them.
- name: Build all lambdas
run: cd lambdas && cargo lambda build --release
- name: Deploy lambdas
run: |
LAMBDAS="axumed
get-ratings
get-ratings-analysis
get-ratings-cities
get-ratings-results
get-cities
get-cities-ratings
get-cities-census
get-cities-submissions
get-price-fargate
patch-ratings-analysis
patch-cities-submissions
post-ratings
post-ratings-analysis
post-ratings-enqueue
post-cities
post-cities-submissions"
echo $LAMBDAS \
| xargs -n1 -t \
cargo lambda deploy \
--iam-role ${{ secrets.BNAAPI_ROLE_ARN_STAGING }} \
--env-var DATABASE_URL_SECRET_ID=${{ secrets.DATABASE_URL_SECRET_ID_STAGING }}