add sensor metadata #21
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: 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 poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- run: poetry config virtualenvs.prefer-active-python true | |
- run: poetry install | |
- name: Tests | |
run: poetry run pytest | |
- name: Typing - mypy | |
run: poetry run mypy . | |
- name: Lint - ruff | |
run: poetry run ruff . | |
- name: Lint - black | |
run: poetry 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 | |
- run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- run: poetry config virtualenvs.prefer-active-python true | |
- 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 | |
- run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- run: poetry config virtualenvs.prefer-active-python true | |
- run: make build | |
- run: ENV=prod make deploy-lambda |