Skip to content

Commit 3a10ccc

Browse files
committed
init
0 parents  commit 3a10ccc

File tree

6 files changed

+104
-0
lines changed

6 files changed

+104
-0
lines changed

.github/workflows/ci.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Build
21+
run: |
22+
npm install
23+
npx tsc -p tsconfig.build.json
24+
npm install --omit=dev
25+
mv node_modules dist/
26+
cd dist
27+
zip -r ../dist.zip .
28+
cd ..
29+
30+
- name: Configure AWS credentials
31+
uses: aws-actions/configure-aws-credentials@v1
32+
with:
33+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
34+
role-session-name: github-actions
35+
aws-region: ap-northeast-2
36+
37+
- name: Upload to Lambda
38+
run: |
39+
aws lambda update-function-code --function-name send-email --zip-file fileb://dist.zip

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package-lock.json

package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "send-email",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"keywords": [],
9+
"author": "",
10+
"license": "ISC",
11+
"description": "",
12+
"devDependencies": {
13+
"@types/aws-lambda": "^8.10.141",
14+
"typescript": "^5.5.3"
15+
},
16+
"dependencies": {
17+
"@aws-sdk/client-ses": "^3.616.0",
18+
"@aws-sdk/client-sqs": "^3.616.0"
19+
}
20+
}

src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Handler } from 'aws-lambda';
2+
3+
export const handler: Handler = async (event) => {
4+
console.log(event);
5+
};

tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["node_modules", "dist", "coverage", "test"]
4+
}

tsconfig.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "commonjs",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"sourceMap": true,
8+
"outDir": "./dist",
9+
"esModuleInterop": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"baseUrl": ".",
12+
"paths": {
13+
"src/*": ["src/*"]
14+
},
15+
16+
"strict": true,
17+
"noImplicitAny": true,
18+
"strictNullChecks": true,
19+
"strictFunctionTypes": true,
20+
"strictPropertyInitialization": true,
21+
"noImplicitThis": true,
22+
"useUnknownInCatchVariables": true,
23+
"alwaysStrict": true,
24+
"noUnusedLocals": true,
25+
"noUnusedParameters": true,
26+
"exactOptionalPropertyTypes": true,
27+
"noImplicitReturns": true,
28+
"noFallthroughCasesInSwitch": true,
29+
"noUncheckedIndexedAccess": true,
30+
"noImplicitOverride": true,
31+
"skipLibCheck": true
32+
},
33+
"exclude": ["node_modules", "dist", "coverage"]
34+
}

0 commit comments

Comments
 (0)