-
Notifications
You must be signed in to change notification settings - Fork 90
49 lines (45 loc) · 1.27 KB
/
usage-log-aggregator-lambda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Test and deploy usage-log-aggregator lambda
on:
pull_request:
paths:
- .github/workflows/usage-log-aggregator-lambda.yml
- aws/lambda/usage-log-aggregator/**
push:
branches:
- main
paths:
- .github/workflows/usage-log-aggregator-lambda.yml
- aws/lambda/usage-log-aggregator/**
defaults:
run:
working-directory: aws/lambda/usage-log-aggregator/
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- run: pip install -r requirements.txt
- run: pytest -v test_lambda_function.py
deploy:
needs: test
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_usage-log-aggregator-lambda
aws-region: us-east-1
- run: make deploy