Merge pull request #421 from Podo-Store/fix/payment-phone-format #236
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: FrontEnd - deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@master | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.OS }}-build- | |
| ${{ runner.OS }}- | |
| - name: Install npm Dependencies | |
| run: npm install | |
| - name: Write .env.production | |
| run: | | |
| cat > .env.production << 'EOF' | |
| VITE_NICEPAY_SDK_URL=${{ secrets.VITE_NICEPAY_SDK_URL }} | |
| VITE_NICEPAY_CLIENT_KEY=${{ secrets.VITE_NICEPAY_CLIENT_KEY }} | |
| VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }} | |
| EOF | |
| - name: Build | |
| env: | |
| CI: "" | |
| REACT_APP_SERVER: ${{ secrets.REACT_APP_SERVER }} | |
| run: npm run build | |
| - 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: ap-northeast-2 | |
| - name: Upload to S3 | |
| run: | | |
| aws s3 cp \ | |
| --recursive \ | |
| --region ap-northeast-2 \ | |
| dist s3://www.podo-store.com | |
| - name: Invalidate files | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} \ | |
| --paths "/*" | |
| - name: Deployment Slack Notification | |
| uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_CHANNEL: "#깃헙액션-배포" | |
| SLACK_COLOR: ${{ job.status == 'success' && 'good' || 'danger' }} | |
| SLACK_MESSAGE: | | |
| *배포 결과:* ${{ job.status == 'success' && '✅ 성공' || '❌ 실패' }} | |
| *프로젝트:* 포도상점 - FrontEnd CI/CD - Deploy | |
| *브랜치:* ${{ github.ref_name }} | |
| *커밋 메시지:* ${{ github.event.head_commit.message }} | |
| *커밋 작성자:* ${{ github.event.head_commit.author.name }} | |
| SLACK_TITLE: "배포 결과 알림" | |
| SLACK_USERNAME: "Notification-Bot" | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| if: always() |