Skip to content

[FE] 잘못된 msw 활성화 조건을 올바르게 수정 #175

[FE] 잘못된 msw 활성화 조건을 올바르게 수정

[FE] 잘못된 msw 활성화 조건을 올바르게 수정 #175

name: frontend deploy dev
on:
workflow_dispatch:
pull_request:
types:
- closed
branches: ["develop"]
paths:
- "frontend/**"
permissions:
contents: read
jobs:
build-and-upload:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
defaults:
run:
working-directory: frontend
steps:
- name: Setup Repository
uses: actions/checkout@v4
- name: Setup node with cache
uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Setup environment variables
run: |
echo "REACT_APP_BASE_URL=${{ secrets.REACT_APP_DEV_BASE_URL }}" >> .env
- name: Install dependencies
run: npm ci
- name: Build App
run: npm run build:dev
- name: Upload frontend build file to artifact
uses: actions/upload-artifact@v4
with:
name: FrontendApplication
path: frontend/dist
deploy:
needs: build-and-upload
runs-on: self-hosted
env:
CLOUD_FRONT_DISTRIBUTION_ID: ${{ secrets.CLOUD_FRONT_DEV_DISTRIBUTION_ID}}
steps:
- name: Remove previous version app
working-directory: frontend/dev/
run: rm -rf dist
- name: Download build file from artifact
uses: actions/download-artifact@v4
with:
name: FrontendApplication
path: frontend/dev/dist
- name: Deploy DEV frontend
working-directory: frontend/dev/
run: |
rm -f /home/ubuntu/team-by-team/frontend/backup/*
mv /home/ubuntu/team-by-team/frontend/www/dist/* /home/ubuntu/team-by-team/frontend/backup/
mv ./dist/* /home/ubuntu/team-by-team/frontend/www/dist/
aws s3 sync /home/ubuntu/team-by-team/frontend/www/dist/ s3://team-by-team-static-resource/dev/front --delete
aws cloudfront create-invalidation --distribution-id "$CLOUD_FRONT_DISTRIBUTION_ID" --paths "/*"