Skip to content

Commit

Permalink
Lambdaへのデプロイを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayashi-m42 committed Sep 20, 2024
1 parent a9c7656 commit 5bf22df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches:
- main
- feature/issue13

env:
ECR_REPOSITORY: stg-lgtm-image-processor
FUNCTION_NAME: stg-lgtm-image-processor

jobs:
build:
name: Build and Deploy to Staging
name: Build Docker Image and Deploy to Lambda to Staging
timeout-minutes: 15
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -55,3 +57,15 @@ jobs:
provenance: false
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/arm64

- name: Deploy to Lambda
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: lgtm-cat-processor-deploy-test
hide-cloudwatch-logs: true
env-vars-for-codebuild: |
IMAGE_URI,
FUNCTION_NAME
env:
IMAGE_URI: ${{ steps.meta.outputs.tags }}
FUNCTION_NAME: ${{ env.FUNCTION_NAME }}
7 changes: 7 additions & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2

phases:
build:
commands:
- aws lambda update-function-code --function-name ${FUNCTION_NAME} --image-uri ${IMAGE_URI}
- aws lambda wait function-updated --function-name ${FUNCTION_NAME}

0 comments on commit 5bf22df

Please sign in to comment.