Skip to content

Commit

Permalink
merge: [FE] ncp object storage에서 s3, cloudfront를 사용한 배포로 변경 (#28)
Browse files Browse the repository at this point in the history
merge: [FE] ncp object storage에서 s3, cloudfront를 사용한 배포로 변경 (#28)
  • Loading branch information
d0422 authored Nov 13, 2023
2 parents 4dbaaa8 + 99663ef commit d4bd369
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/front-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: frontEnd CI
on:
pull_request:
branches: [FE/release, dev, 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
14 changes: 9 additions & 5 deletions .github/workflows/front-release-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: frontEnd test deploy
name: frontEnd CI/CD
on:
pull_request:
branches: FE/release
push:
branches: [FE/release, main]
jobs:
build-test-deploy:
runs-on: ubuntu-22.04
Expand All @@ -25,11 +25,15 @@ jobs:
working-directory: ./frontEnd
run: npm run build

- name: ⬆️ Object Storage 업로드
- 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 --endpoint-url=https://kr.object.ncloudstorage.com s3 cp --recursive dist s3://algoitni
aws s3 sync ./dist s3://algoitni-deploy
- name: 🔄️ Cloudfront edge 로케이션에 대한 캐시 무효화
run: |
aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_CLOUD_FRONT_ID}} --paths "/*"

0 comments on commit d4bd369

Please sign in to comment.