Skip to content

feat: script to lambda#43

Merged
Perry2004 merged 1 commit intomainfrom
feat/script-to-lambda
Oct 13, 2025
Merged

feat: script to lambda#43
Perry2004 merged 1 commit intomainfrom
feat/script-to-lambda

Conversation

@Perry2004
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings October 13, 2025 05:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR converts an existing Python script into an AWS Lambda function by adding a Lambda handler and creating the necessary CI/CD infrastructure to build and deploy it.

  • Created a Lambda handler wrapper around the existing get_image_links_selenium function
  • Added a GitHub workflow to build and deploy the Lambda function to S3
  • Updated the existing website deployment workflow to organize S3 objects into directories

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/lambda-handler.py New Lambda handler that wraps the existing image scraping functionality
.github/workflows/build-lambda.yaml New CI/CD workflow to build and deploy the Lambda function
.github/workflows/push-artifacts.yaml Modified S3 deployment path to organize website files in a subdirectory

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

mkdir -p dist

# Install dependencies to build directory
uv sync --no-cache --target dist
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uv sync --target command expects a virtual environment, but this installs packages directly to the dist directory. Consider using uv pip install -r requirements.txt --target dist or create a virtual environment first.

Suggested change
uv sync --no-cache --target dist
uv pip install -r requirements.txt --target dist

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +52
- name: Invalidate CloudFront cache
uses: foxdalas/cloudfront-invalidator@v4
with:
tag_key: "Name"
tag_value: ${{ secrets.CLOUDFRONT_DISTRIBUTION_NAME }}
paths: "/*"
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloudFront invalidation is unnecessary for Lambda function deployments as they don't affect the CDN cache. This step should be removed from the Lambda build workflow.

Suggested change
- name: Invalidate CloudFront cache
uses: foxdalas/cloudfront-invalidator@v4
with:
tag_key: "Name"
tag_value: ${{ secrets.CLOUDFRONT_DISTRIBUTION_NAME }}
paths: "/*"
# (CloudFront invalidation step removed)

Copilot uses AI. Check for mistakes.
@Perry2004 Perry2004 force-pushed the feat/script-to-lambda branch from 3404a62 to 5e2c7b1 Compare October 13, 2025 05:16
@Perry2004 Perry2004 merged commit ff691b0 into main Oct 13, 2025
3 checks passed
@Perry2004 Perry2004 deleted the feat/script-to-lambda branch October 13, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants