🔧 Add github actions CI/CD config #1
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: Deploy React App to S3 | |
on: | |
push: | |
branches: | |
- main # Trigger this workflow on push to main branch | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies and build | |
run: | | |
yarn install | |
yarn run build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY_ID }} | |
aws-region: ap-northeast-2 | |
- name: Deploy to S3 | |
run: | | |
aws s3 sync dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete |