From a49264ec1495d60a59b7194e4010f9168aea716a Mon Sep 17 00:00:00 2001 From: kimdonghyun Date: Tue, 8 Jul 2025 01:54:24 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=84=EC=9A=A9=20Lambda=20=ED=81=AC=EB=A1=A4=EB=9F=AC=20wor?= =?UTF-8?q?kflow=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-test.yml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy-test.yml diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml new file mode 100644 index 0000000..b229109 --- /dev/null +++ b/.github/workflows/deploy-test.yml @@ -0,0 +1,47 @@ +name: Deploy to AWS Lambda Test + +on: + workflow_dispatch: + +env: + AWS_REGION: ap-northeast-2 + ECR_CRAWL_REPO_NAME: dev/crawl + LAMBDA_FUNCTION_NAME: withins-playwright-crawler-test + +jobs: + deploy: + name: Deploy to AWS Lambda + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ECR_LAMBDA_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_ECR_LAMBDA_SECRET_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push Docker image + id: build-image + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: ${{ env.ECR_CRAWL_REPO_NAME }} + IMAGE_TAG: ${{ github.sha }} + run: | + IMAGE_URI=$REGISTRY/$REPOSITORY:$IMAGE_TAG + docker build -t $IMAGE_URI . + docker push $IMAGE_URI + echo "image-uri=$IMAGE_URI" >> $GITHUB_OUTPUT + + - name: Deploy to Lambda + uses: int128/deploy-lambda-action@v1 + with: + function-name: ${{ env.LAMBDA_FUNCTION_NAME }} + image-uri: ${{ steps.build-image.outputs.image-uri }} \ No newline at end of file