Conversation
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 }} |
| - name: Install Dependencies | ||
| run: yarn install --frozen-lockfile | ||
| - name: Build Project | ||
| run: yarn build |
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.