Skip to content

Commit

Permalink
fix: 스토리북 배포 워크플로우에서 캐시 무효화 로직 삭제 및 mockServiceWorker 경로 수정 (#466)
Browse files Browse the repository at this point in the history
* chore/#465: 클라우드프론트 캐시 무효화 로직 워크플로우에서 삭제

* chore/#465: 스토리북 mockServiceWorker 경로 설정
  • Loading branch information
HyeryongChoi authored Oct 6, 2023
1 parent c42bc9f commit dfd6132
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/frontend-storybook-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,3 @@ jobs:
- name: Upload to S3
run: |
aws s3 sync frontend/storybook s3://2023-team-project/2023-zipgo/storybook --delete
- name: Cloudfront invalidation
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} \
--paths "/storybook/*"
13 changes: 12 additions & 1 deletion frontend/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ import { initialize, mswDecorator } from 'msw-storybook-addon';
import { withRouter } from 'storybook-addon-react-router-v6';
import handlers from '../src/mocks/handlers';

initialize(); // msw-storybook-addon
let options = {};

if (location.hostname.includes('cloudfront')) {
options = {
serviceWorker: {
url: '/storybook/mockServiceWorker.js',
},
};
}

// Initialize MSW
initialize(options);

const queryClient = new QueryClient({
defaultOptions: {
Expand Down

0 comments on commit dfd6132

Please sign in to comment.