Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
@@ -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 }}