Skip to content

chore: reduce meta complexity #49

chore: reduce meta complexity

chore: reduce meta complexity #49

Workflow file for this run

name: API Lambda Deploy ⁁
on:
push:
branches:
- main
paths:
- api/**
- .github/workflows/api-deploy.yml
tags:
- '*.*.*'
permissions:
contents: read
jobs:
build-deploy:
environment: ${{ github.ref == 'refs/heads/main' && 'dev' || 'prod' }}
name: Build & Deploy 📦
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Install dependencies
run: pip install cargo-lambda
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
api
- name: Build
run: cargo lambda build --release --output-format zip
- name: Upload to Lambda
run: aws lambda update-function-code --function-name kb2-lambda-function-${{ github.ref == 'refs/heads/main' && 'dev' || 'prod' }} --zip-file fileb://target/lambda/api/bootstrap.zip