Skip to content

merge: 프론트엔드 배포 오류 해결 (#30) #25

merge: 프론트엔드 배포 오류 해결 (#30)

merge: 프론트엔드 배포 오류 해결 (#30) #25

name: frontEnd CI/CD
on:
push:
branches: [FE/release, main]
jobs:
build-test-deploy:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.16.0]
steps:
- name: ✅ 코드 체크아웃
uses: actions/checkout@v3
- name: ⬇️ 의존성 설치
working-directory: ./frontEnd
run: npm install
- name: ✅ 유닛 테스트
working-directory: ./frontEnd
run: npm test
- name: 📦 프로젝트 빌드
working-directory: ./frontEnd
run: npm run build
- name: ⬆️ S3업로드
working-directory: ./frontEnd
env:
AWS_ACCESS_KEY_ID: '${{secrets.AWS_ACCESS_KEY_ID}}'
AWS_SECRET_ACCESS_KEY: '${{secrets.AWS_SECRET_ACCESS_KEY}}'
AWS_DEFAULT_REGION: '${{secrets.AWS_DEFAULT_REGION}}'
run: |
aws s3 sync ./dist s3://algoitni-deploy
- name: 🔄️ Cloudfront edge 로케이션에 대한 캐시 무효화
env:
AWS_ACCESS_KEY_ID: '${{secrets.AWS_ACCESS_KEY_ID}}'
AWS_SECRET_ACCESS_KEY: '${{secrets.AWS_SECRET_ACCESS_KEY}}'
AWS_DEFAULT_REGION: '${{secrets.AWS_DEFAULT_REGION}}'
run: |
aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_CLOUD_FRONT_ID}} --paths "/*"