[FE-Feat] 401 처리, 토큰 만료 기간 처리, 에러핸들링 (#250) #21
This file contains 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/**" | |
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 | |
# EC2로 파일 전송 | |
- name: Copy files to EC2 | |
uses: appleboy/[email protected] | |
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 | |
bash deploy_scripts/frontend_deploy.sh |