-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
serverless.yml
83 lines (74 loc) · 1.65 KB
/
serverless.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
service: issuelabler-bot
frameworkVersion: "2"
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: 20201221
httpApi:
cors:
allowedOrigins:
- '*'
allowedHeaders:
- '*'
allowedMethods:
- get
- options
- post
allowCredentials: false
stage: ${opt:stage, 'development'}
region: ${opt:region, 'ap-southeast-1'}
environment:
NODE_ENV: ${opt.stage, 'development'}
APP_ID: ${file(env.yml):secrets.APP_ID, ''}
WEBHOOK_SECRET: ${file(env.yml):secrets.WEBHOOK_SECRET, ''}
PRIVATE_KEY_PATH: ${file(env.yml):secrets.PRIVATE_KEY_PATH, ''}
DISABLE_STATS: true
LOG_LEVEL: error
plugins:
- serverless-plugin-scripts
custom:
scripts:
hooks:
'package:initialize': make
'deploy:finalize': make clean
package:
individually: true
include:
- 'src/**'
- 'package.json'
- 'package-lock.json'
exclude:
- '**/*'
layers:
modulesLib:
package:
artifact: modules.zip
compatibleRuntimes:
- nodejs14.x
privateKey:
package:
artifact: key.zip
functions:
labelerbot:
handler: 'src/handler.bot'
name: issuelabeler-bot-${self:provider.stage}
memorySize: 256
timeout: 15
layers:
- { Ref: ModulesLibLambdaLayer }
- { Ref: PrivateKeyLambdaLayer }
events:
- httpApi:
path: /api/webhooks/github
method: post
catch:
handler: 'src/static.catch'
name: issuelabeler-bot-catch-${self:provider.stage}
memorySize: 128
timeout: 5
layers:
- { Ref: ModulesLibLambdaLayer }
events:
- httpApi:
path: /ping
method: get