Merge pull request #294 from StarSync-FE/develop #10
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 to S3 and CloudFront | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| BUCKET_NAME: starsync | |
| VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }} | |
| steps: | |
| - name: Github Repository 파일 불러오기 | |
| uses: actions/checkout@v4 | |
| - name: Node.js 환경 설정 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.14.0 | |
| - name: 의존성 설치 (npm ci) | |
| run: npm ci | |
| - name: 프로젝트 빌드 (Vite) | |
| run: npm run build | |
| - name: AWS 인증 정보 설정 | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| 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에 dist 폴더 배포 | |
| run: aws s3 sync dist/ s3://$BUCKET_NAME --delete | |
| - name: CloudFront 캐시 무효화 | |
| run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |