fix: Like 관련 람다에서 실행하는 로직 오류 수정 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy_lambda | |
on: | |
push: | |
branches: [ feat/like_service ] | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test Deploy' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: JDK 세팅 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle without test | |
run: ./gradlew clean build -x test buildZip | |
- name: Create deployment package | |
run: | | |
mkdir -p deployment | |
cp build/distributions/lambda-function.zip deployment/ | |
if [ -d "lib" ]; then | |
cp -R lib/* deployment/ | |
fi | |
cd deployment | |
zip -r ../function.zip . | |
- name: AWS 계정 세팅 | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: S3에 패키지 업로드 | |
run: | | |
aws s3 cp function.zip s3://gureumi-s3/deploy/function.zip | |
- name: 람다 배포 | |
run: | | |
aws lambda update-function-code \ | |
--function-name ${{ secrets.LAMBDA_FUNCTION_NAME }} \ | |
--s3-bucket gureumi-s3 \ | |
--s3-key deploy/function.zip |