Skip to content

cd: publish built artifacts to s3#32

Merged
Perry2004 merged 1 commit intomainfrom
cd/push-to-s3
Oct 11, 2025
Merged

cd: publish built artifacts to s3#32
Perry2004 merged 1 commit intomainfrom
cd/push-to-s3

Conversation

@Perry2004
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings October 11, 2025 18:35
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 adds a new GitHub Actions workflow to automatically build and publish artifacts to S3 when code is pushed to the main branch.

  • Introduces automated deployment pipeline for built artifacts
  • Configures AWS credentials using OIDC for secure S3 access
  • Sets up Node.js build environment with yarn package manager

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

run: yarn build
- name: Deploy to S3
run: |
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET }} --delete
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The --delete flag will remove files from S3 that don't exist locally, which could lead to unintended data loss. Consider adding error handling or removing this flag if not necessary for the deployment strategy.

Suggested change
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET }} --delete
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET }}

Copilot uses AI. Check for mistakes.
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build Project
run: yarn build
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

Consider adding error handling and validation before the S3 sync operation. The build could succeed but produce an empty or invalid dist directory, which would then sync to S3.

Suggested change
run: yarn build
run: yarn build
- name: Validate dist directory
run: |
if [ ! -d "./dist" ] || [ -z "$(ls -A ./dist)" ]; then
echo "Error: dist directory does not exist or is empty. Aborting deployment."
exit 1
fi

Copilot uses AI. Check for mistakes.
@Perry2004 Perry2004 merged commit 8afbe0c into main Oct 11, 2025
3 checks passed
@Perry2004 Perry2004 deleted the cd/push-to-s3 branch October 11, 2025 18:37
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