-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (55 loc) · 1.55 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
name: Python application test with Github Actions
on:
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: aws-actions/setup-sam@v2
- name: Install dependencies
run: |
make install
- name: Lint
run: |
make lint
- name: Test with pytest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
make test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Configure AWS CodeArtifact
run: |
aws codeartifact login --tool twine --domain tba-investments --domain-owner $(aws sts get-caller-identity --query 'Account' --output text) --repository tba-investments-etl
- name: Build package
run: make build-package
- name: Publish package
run: make publish-package
- name: SAM build
if: success()
env:
AWS_SAM_STACK_NAME: ${{ secrets.AWS_SAM_STACK_NAME }}
run: |
make build-sam
- name: SAM deploy
if: success()
env:
AWS_SAM_STACK_NAME: ${{ secrets.AWS_SAM_STACK_NAME }}
run: |
make deploy-sam