enh: lambda error handling #2
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: Deploy Bot Lambda | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- app/bot/** | |
- .github/workflows/lambda-deploy.yml | |
concurrency: | |
group: ghas-erfiume-bot-lambda-deploy-${{ github.ref }} | |
jobs: | |
rust-ci-bot: | |
permissions: | |
actions: read | |
security-events: write | |
contents: read | |
uses: notdodo/github-actions/.github/workflows/[email protected] | |
with: | |
working-directory: ./app/bot | |
lambda-bot-deploy: | |
needs: rust-ci-bot | |
name: Deploy Lambda | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
defaults: | |
run: | |
working-directory: ./app/bot | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | |
# v4.2.1 | |
with: | |
fetch-depth: 0 | |
- uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
# v4.0.2 | |
with: | |
role-to-assume: arn:aws:iam::841162699174:role/erfiume-oidc-write | |
aws-region: eu-west-1 | |
retry-max-attempts: 2 | |
- name: Cargo cache | |
uses: swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab | |
# v2.7.5 | |
with: | |
cache-on-failure: true | |
cache-all-crates: true | |
workspaces: ./app/bot | |
- name: Install Zig toolchain | |
uses: korandoru/setup-zig@v1 | |
with: | |
zig-version: master | |
- name: Install Cargo Lambda | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: cargo-lambda/cargo-lambda | |
platform: linux | |
arch: x86_64 | |
- name: Build and deploy Lambda | |
run: | | |
cargo lambda build --release | |
cargo lambda deploy |