Skip to content

feat: 어드민 아닐시 리다렉 로직 추가 #13

feat: 어드민 아닐시 리다렉 로직 추가

feat: 어드민 아닐시 리다렉 로직 추가 #13

Workflow file for this run

name: Deploy Development to S3 and invalidate CloudFront Cache
on:
push:
branches:
- dev-fe #dev-fe가 trigger 브랜치
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
# 1. 소스코드 체크아웃

Check failure on line 17 in .github/workflows/frontend-dev-cd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/frontend-dev-cd.yml

Invalid workflow file

You have an error in your yaml syntax on line 17
- name: Checkout Source Code
uses: actions/checkout@v3
# 2. Node.js 설치 (필요시)
- name: Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# 3. 빌드
- run: npm --force ci
- name: Build Production
run: CI=false npm run build --if-present
# 4. AWS Credentials 설정
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2 # 서울 리전
# 5. S3에 파일 업로드
- name: Deploy to S3
run: |
aws s3 sync build/ s3://dev-fe.bang-ggood.com --delete
# 6. CloudFront 캐시 무효화
- name: Invalidate CloudFront Cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"