mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Testing later arn
This commit is contained in:
parent
59b23e46c3
commit
f7c433d373
2 changed files with 11 additions and 14 deletions
23
.github/workflows/deploy_fastapi_backend.yml
vendored
23
.github/workflows/deploy_fastapi_backend.yml
vendored
|
|
@ -44,23 +44,20 @@ jobs:
|
|||
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: eu-west-2
|
||||
|
||||
- name: Install lambda specific dependencies, with bianries, in a separate dir
|
||||
run: |
|
||||
mkdir python
|
||||
pip install -r backend/requirements/lambda.txt -t python
|
||||
|
||||
- name: Create Layer package
|
||||
run: |
|
||||
zip -r layer.zip python
|
||||
|
||||
- name: Deploy Layer to Lambda
|
||||
run: |
|
||||
aws lambda publish-layer-version --layer-name LambdaDependenciesLayer --zip-file fileb://layer.zip
|
||||
|
||||
- name: Set domain name
|
||||
id: set_domain
|
||||
run: echo "::set-output name=domain::${{ secrets[format('{0}_DOMAIN_NAME', github.ref_name)] }}"
|
||||
|
||||
- name: Build Lambda Layer
|
||||
run: |
|
||||
pip install -r requirements/lambda.txt -t python
|
||||
zip -r layer.zip python
|
||||
|
||||
- name: Publish Lambda Layer
|
||||
run: |
|
||||
LAYER_ARN=$(aws lambda publish-layer-version --layer-name LambdaDependenciesLayer --zip-file fileb://layer.zip | jq -r '.LayerVersionArn')
|
||||
aws ssm put-parameter --name "/${{ github.ref_name }}/LambdaDependenciesLayerArn" --value "$LAYER_ARN" --type String --overwrite
|
||||
|
||||
- name: Deploy to AWS Lambda via Serverless
|
||||
env:
|
||||
API_KEY: ${{ secrets.FASTAPI_API_KEY }}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ functions:
|
|||
app:
|
||||
handler: app.main.handler
|
||||
layers:
|
||||
- { Ref: LambdaDependenciesLayer }
|
||||
- ${ssm:/${self:provider.environment.ENVIRONMENT}/LambdaDependenciesLayerArn}
|
||||
events:
|
||||
- http:
|
||||
path: /{proxy+}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue