Update main.yml #3
This file contains 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
name: Upload to AWS S3 | |
# Defines the event for the workflow. In this case, it triggers on push events to the main branch. | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy to S3 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 # Use a specific version like 'v2' instead of 'main' | |
# Configure AWS Credentials | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 # specify your AWS region, e.g., us-east-1 | |
# Deploy to S3 | |
- name: Deploy to S3 | |
run: | | |
aws s3 sync ${{ github.workspace }}/FrontendCode s3://fyrescannerfrontend --acl public-read --follow-symlinks --delete --exclude '.github*/*' | |
env: | |
AWS_S3_BUCKET: fyrescannerfrontend | |
SOURCE_DIR: 'FrontendCode' # This environment variable is not necessary unless used in the script |