refactor: setup common types for service #48
Workflow file for this run
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup git credentials | |
run: git config --global url."https://${{ secrets.GIT_CREDENTIALS }}@github.com".insteadOf https://github.com | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.74.0 | |
profile: minimal | |
- name: Install Cargo Lambda | |
run: pip install cargo-lambda==1.0.0 | |
- name: Build lambda | |
run: cargo lambda build --release | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' # deploy only in main | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup git credentials | |
run: git config --global url."https://${{ secrets.GIT_CREDENTIALS }}@github.com".insteadOf https://github.com | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.74.0 | |
profile: minimal | |
- name: Install Cargo Lambda | |
run: pip install cargo-lambda==1.0.0 | |
- name: Build lambda | |
run: cargo lambda build --release | |
- name: Deploy lambda | |
run: cargo lambda deploy --enable-function-url link-for-later-lambda | |
env: | |
AWS_DEFAULT_REGION: ap-southeast-1 | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |