✨ Feat: ec2 -> s3 버킷으로 서빙 변경 #1
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
| name: Deploy React to S3 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 코드 가져오기 | |
| uses: actions/checkout@v3 | |
| - name: Node 설치 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| - name: npm install | |
| run: npm install | |
| - name: React build | |
| run: npm run build | |
| - name: AWS 인증 | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - name: S3 업로드 | |
| run: aws s3 sync build/ s3://${{ secrets.S3_BUCKET_NAME }} --delete |