chore(config): S3 업로드 시 로고 디렉토리 제외 #2
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 Production | |
| on: | |
| push: | |
| branches: | |
| - release | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: pnpm 설치 | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Node.js 설정 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: 의존성 설치 | |
| run: pnpm install --frozen-lockfile | |
| - name: 빌드 | |
| run: pnpm 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: ap-northeast-2 | |
| - name: S3 업로드 | |
| run: | | |
| aws s3 sync dist/ s3://shinhansec-sol-lite-frontend \ | |
| --delete \ | |
| --cache-control "public, max-age=31536000, immutable" \ | |
| --exclude "index.html" \ | |
| --exclude "KOSPI-logo/*" \ | |
| --exclude "KOSDAQ-logo/*" \ | |
| --exclude "us-logo/*" \ | |
| --exclude "avatars/*" \ | |
| --exclude "preset-thumbnails/*" | |
| aws s3 cp dist/index.html s3://shinhansec-sol-lite-frontend/index.html \ | |
| --cache-control "no-cache, no-store, must-revalidate" | |
| - name: CloudFront 캐시 무효화 | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id E8T0CPVZH2V3V \ | |
| --paths "/*" |