-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.67 KB
/
deploy.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
60
name: deploy
on:
push:
branches:
- main
paths:
- '.github/workflows/deploy.yml'
- 'src/lambdas/**'
- 'src/layers/**'
- 'samconfig.toml'
- 'template.yml'
- 'poetry.lock'
- 'pyproject.toml'
permissions:
id-token: write
contents: read
concurrency: deploy
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: aws-actions/setup-sam@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.DEPLOY_ROLE_ARN }}
role-session-name: GitHubDeploySession
- name: Export requirements
shell: bash
run: |
pip install poetry
mkdir ./src/layers/fastapi
poetry export --with api --output ./src/lambdas/api/requirements.txt
poetry export --with layers-api --output ./src/layers/api/requirements.txt
poetry export --with layers-databases --output ./src/layers/databases/requirements.txt
poetry export --with layers-fastapi --output ./src/layers/fastapi/requirements.txt
poetry export --with layers-utils --output ./src/layers/utils/requirements.txt
- name: build
run: sam build --use-container --build-image public.ecr.aws/sam/build-python3.9
- name: deploy
run: |
sam deploy --parameter-overrides \
DomainName="moshan.fulder.dev" \
TmdbToken=${{ secrets.TMDB_TOKEN }} \
LocalCognitoClient=${{ secrets.LOCAL_COGNITO_CLIENT }}