[FE-Refactor] Tanstack Router의 Code Splitting 조사 및 적용 (#343) #54
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: fe-cd | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - main | |
| paths: | |
| - "frontend/**" | |
| - "script/deploy/frontend_deploy.sh" | |
| - "script/deploy/nginx/**" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # 프론트엔드 빌드 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Set .env file | |
| working-directory: ./frontend | |
| run: | | |
| echo "${{ secrets.FE_ENV }}" > .env | |
| - name: Build Frontend | |
| working-directory: ./frontend | |
| run: | | |
| pnpm install | |
| pnpm build | |
| - name: Copy nginx file to EC2 | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| source: "script/deploy/nginx/*" | |
| target: "~/app/deploy/nginx" | |
| strip_components: 3 | |
| - name: Copy deploy script to EC2 | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| source: "script/deploy/frontend_deploy.sh" | |
| target: "~/app/deploy" | |
| strip_components: 2 | |
| # EC2로 파일 전송 | |
| - name: Copy files to EC2 | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| source: "frontend/dist/" | |
| target: "~/app" | |
| # 배포 스크립트 실행 | |
| - name: Deploy | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| script: | | |
| cd ~/app/deploy | |
| bash ./frontend_deploy.sh |