Skip to content

update tf, add logging #32

update tf, add logging

update tf, add logging #32

name: tmm-api-depoly-aws
on:
push:
paths:
- "services/tmm-api/**"
- ".github/workflows/tmm-api-deploy-aws.yml"
permissions:
id-token: write
jobs:
checks:
defaults:
run:
working-directory: "services/tmm-api"
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- run: uv sync
- name: Tests
run: uv run pytest
- name: Typing - mypy
run: uv run mypy .
- name: Lint - ruff
run: uv run ruff check .
- name: Lint - black
run: uv run black --check .
deploy-dev:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: aws_dev
needs:
- checks
defaults:
run:
working-directory: "services/tmm-api"
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.LAMBDA_DEPLOY_ROLE }}
aws-region: eu-central-1
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- run: uv sync
- run: make build
- run: ENV=dev make deploy-lambda
deploy-prod:
if: github.ref == 'refs/heads/prod'
runs-on: ubuntu-latest
environment: aws_prod
needs:
- checks
defaults:
run:
working-directory: "services/tmm-api"
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.LAMBDA_DEPLOY_ROLE }}
aws-region: eu-central-1
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- run: uv sync
- run: make build
- run: ENV=prod make deploy-lambda