Skip to content

Commit

Permalink
build: deploy to lambda by github action
Browse files Browse the repository at this point in the history
  • Loading branch information
leemhoon00 committed Jul 20, 2024
1 parent 995bb2a commit 885b24e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci

on:
push:
branches:
- main

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build
run: |
npm install
npx tsc -p tsconfig.build.json
npm install --omit=dev
mv node_modules dist/
cd dist
zip -r ../dist.zip .
cd ..
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-actions
aws-region: ap-northeast-2

- name: Upload to Lambda
run: |
aws lambda update-function-code --function-name unsubscribe --zip-file fileb://dist.zip

0 comments on commit 885b24e

Please sign in to comment.