-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.08 KB
/
lambda_deploy.yml
File metadata and controls
68 lines (64 loc) · 2.08 KB
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
61
62
63
64
65
66
67
68
name: Deploy Evaluation Function to Lambda Feedback
on:
workflow_call:
inputs:
environment:
type: string
description: "The environment to deploy to"
required: true
api-url:
type: string
description: "The URL of the backend API"
required: true
image-name:
type: string
description: "The name of the Docker image to deploy"
required: true
function-name:
type: string
description: "The name of the Lambda function to deploy"
required: true
region:
type: string
description: "The AWS region to deploy to"
default: "eu-west-2"
required: false
secrets:
aws-key-id:
description: "The AWS access key ID"
required: true
aws-secret-key:
description: "The AWS secret access key"
required: true
function-admin-api-key:
description: "The API key for the Lambda Feedback function admin API"
required: true
jobs:
deploy:
name: Deploy (${{ inputs.environment }})
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.aws-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-key }}
aws-region: ${{ inputs.region }}
- name: Deploy Evaluation Function
id: deploy-evaluation-function
env:
BACKEND_API_URL: ${{ inputs.api-url }}
API_KEY: ${{ secrets.function-admin-api-key }}
IMAGE_NAME: ${{ inputs.image-name }}
FUNCTION_NAME: ${{ inputs.function-name }}
run: |
curl -f --location --request POST "$BACKEND_API_URL/grading-function/ensure" \
--header 'content-type: application/json' \
--data-raw "{
\"apiKey\": \"$API_KEY\",
\"dockerImageUri\": \"$IMAGE_NAME\",
\"functionName\": \"$FUNCTION_NAME\"
}"