Conversation
There was a problem hiding this comment.
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_seleniumfunction - 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 |
There was a problem hiding this comment.
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.
| uv sync --no-cache --target dist | |
| uv pip install -r requirements.txt --target dist |
.github/workflows/build-lambda.yaml
Outdated
| - name: Invalidate CloudFront cache | ||
| uses: foxdalas/cloudfront-invalidator@v4 | ||
| with: | ||
| tag_key: "Name" | ||
| tag_value: ${{ secrets.CLOUDFRONT_DISTRIBUTION_NAME }} | ||
| paths: "/*" |
There was a problem hiding this comment.
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.
| - name: Invalidate CloudFront cache | |
| uses: foxdalas/cloudfront-invalidator@v4 | |
| with: | |
| tag_key: "Name" | |
| tag_value: ${{ secrets.CLOUDFRONT_DISTRIBUTION_NAME }} | |
| paths: "/*" | |
| # (CloudFront invalidation step removed) |
3404a62 to
5e2c7b1
Compare
No description provided.