Skip to content

Commit affc1c2

Browse files
committed
merge: main 브랜치에 dev 브랜치 병합
1 parent 34d6f80 commit affc1c2

258 files changed

Lines changed: 34670 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_KAKAO_REDIRECT_URI=https://d3741u3vzg4n3d.cloudfront.net/loginSuccess

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
> ex) #이슈번호
33
44
### PR 타입(하나 이상의 PR 타입을 선택해주세요)
5-
-[] 기능 추가
6-
-[] 기능 삭제
7-
-[] 버그 수정
8-
-[] 의존성, 환경 변수, 빌드 관련 코드 업데이트
5+
- [ ] 기능 추가
6+
- [ ] 기능 삭제
7+
- [ ] 버그 수정
8+
- [ ] 의존성, 환경 변수, 빌드 관련 코드 업데이트
99

1010
## 💻 작업 내용
1111
> 이번 PR에서 작업한 내용을 간략히 설명해주세요

.github/workflows/build-and-deploy.yaml

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- test
8+
- dev
89

910
jobs:
1011
deploy:
@@ -14,32 +15,63 @@ jobs:
1415
- name: Checkout code
1516
uses: actions/checkout@v4
1617

17-
- name: Use Node.js 20
18-
uses: actions/setup-node@v4
18+
- name: Use Node.js 20 + pnpm
19+
uses: pnpm/action-setup@v2
20+
with:
21+
version: 8
22+
23+
- uses: actions/setup-node@v4
1924
with:
2025
node-version: 20
26+
cache: 'pnpm'
2127

2228
- name: Install dependencies
23-
run: yarn install
29+
run: pnpm install
30+
31+
- name: Inject environment variables
32+
run: |
33+
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" >> .env
34+
echo "VITE_KAKAO_JS_KEY=${{ secrets.VITE_KAKAO_JS_KEY }}" >> .env
35+
echo "VITE_SIGNATURE_ENCRYPTION_KEY=${{ secrets.VITE_SIGNATURE_ENCRYPTION_KEY }}" >> .env
36+
37+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
38+
echo "VITE_KAKAO_REDIRECT_URI=${{ secrets.VITE_KAKAO_REDIRECT_URI_PROD }}" >> .env.production
39+
elif [ "${{ github.ref }}" = "refs/heads/test" ]; then
40+
echo "VITE_KAKAO_REDIRECT_URI=${{ secrets.VITE_KAKAO_REDIRECT_URI_TEST }}" >> .env.test
41+
else
42+
echo "VITE_KAKAO_REDIRECT_URI=${{ secrets.VITE_KAKAO_REDIRECT_URI_DEV }}" >> .env.development
43+
fi
2444
2545
- name: Build React app
26-
run: yarn build
46+
run: |
47+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
48+
pnpm build:prod
49+
elif [ "${{ github.ref }}" = "refs/heads/test" ]; then
50+
pnpm build:test
51+
else
52+
pnpm build:dev
53+
fi
2754
28-
- name: Upload to S3
29-
uses: jakejarvis/s3-sync-action@master
55+
- name: Configure AWS credentials
56+
uses: aws-actions/configure-aws-credentials@v2
3057
with:
31-
args: --delete
58+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
59+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
60+
aws-region: ap-northeast-2
61+
62+
- name: Sync to S3
63+
run: aws s3 sync dist/ s3://$S3_BUCKET --delete
3264
env:
33-
AWS_S3_BUCKET: ${{ github.ref == 'refs/heads/main' && secrets.AWS_S3_BUCKET || secrets.AWS_S3_BUCKET_TEST }}
34-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
35-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36-
AWS_REGION: ap-northeast-2
37-
SOURCE_DIR: dist
65+
S3_BUCKET: ${{ github.ref == 'refs/heads/main' && secrets.AWS_S3_BUCKET
66+
|| github.ref == 'refs/heads/test' && secrets.AWS_S3_BUCKET_TEST
67+
|| secrets.AWS_S3_BUCKET_DEV }}
3868

3969
- name: Invalidate CloudFront cache
4070
uses: chetan/invalidate-cloudfront-action@v2
4171
env:
42-
DISTRIBUTION: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDFRONT_DISTRIBUTION_ID || secrets.CLOUDFRONT_DISTRIBUTION_ID_TEST }}
72+
DISTRIBUTION: ${{ github.ref == 'refs/heads/main' && secrets.CLOUDFRONT_DISTRIBUTION_ID
73+
|| github.ref == 'refs/heads/test' && secrets.CLOUDFRONT_DISTRIBUTION_ID_TEST
74+
|| secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }}
4375
PATHS: '/*'
4476
AWS_REGION: ap-northeast-2
4577
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ dist-ssr
2424
*.sw?
2525

2626
# env
27-
.env
28-
.env.local
27+
.env*
28+
.env.production
29+
.env.development
30+
.env.development.local
31+
.env.test

.storybook/main.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.stories.@(ts|tsx)"],
5+
addons: ["@storybook/addon-essentials", "@storybook/addon-interactions"],
6+
framework: {
7+
name: "@storybook/react-vite",
8+
options: {},
9+
},
10+
docs: {
11+
autodocs: "tag",
12+
},
13+
};
14+
15+
export default config;

.storybook/preview.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import "../src/index.css"; // Tailwind CSS가 포함된 전역 CSS
2+
3+
export const parameters = {
4+
actions: { argTypesRegex: "^on[A-Z].*" },
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/,
9+
},
10+
},
11+
};

.storybook/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["@storybook/react"],
5+
"module": "ESNext",
6+
"moduleResolution": "Node",
7+
"jsx": "react-jsx"
8+
},
9+
"include": ["../src", "./"]
10+
}
11+

dev-dist/registerSW.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-dist/sw.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* Copyright 2018 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
// If the loader is already loaded, just stop.
15+
if (!self.define) {
16+
let registry = {};
17+
18+
// Used for `eval` and `importScripts` where we can't get script URL by other means.
19+
// In both cases, it's safe to use a global var because those functions are synchronous.
20+
let nextDefineUri;
21+
22+
const singleRequire = (uri, parentUri) => {
23+
uri = new URL(uri + ".js", parentUri).href;
24+
return registry[uri] || (
25+
26+
new Promise(resolve => {
27+
if ("document" in self) {
28+
const script = document.createElement("script");
29+
script.src = uri;
30+
script.onload = resolve;
31+
document.head.appendChild(script);
32+
} else {
33+
nextDefineUri = uri;
34+
importScripts(uri);
35+
resolve();
36+
}
37+
})
38+
39+
.then(() => {
40+
let promise = registry[uri];
41+
if (!promise) {
42+
throw new Error(`Module ${uri} didn’t register its module`);
43+
}
44+
return promise;
45+
})
46+
);
47+
};
48+
49+
self.define = (depsNames, factory) => {
50+
const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
51+
if (registry[uri]) {
52+
// Module is already loading or loaded.
53+
return;
54+
}
55+
let exports = {};
56+
const require = depUri => singleRequire(depUri, uri);
57+
const specialDeps = {
58+
module: { uri },
59+
exports,
60+
require
61+
};
62+
registry[uri] = Promise.all(depsNames.map(
63+
depName => specialDeps[depName] || require(depName)
64+
)).then(deps => {
65+
factory(...deps);
66+
return exports;
67+
});
68+
};
69+
}
70+
define(['./workbox-86c9b217'], (function (workbox) { 'use strict';
71+
72+
self.skipWaiting();
73+
workbox.clientsClaim();
74+
75+
/**
76+
* The precacheAndRoute() method efficiently caches and responds to
77+
* requests for URLs in the manifest.
78+
* See https://goo.gl/S9QRab
79+
*/
80+
workbox.precacheAndRoute([{
81+
"url": "registerSW.js",
82+
"revision": "3ca0b8505b4bec776b69afdba2768812"
83+
}, {
84+
"url": "index.html",
85+
"revision": "0.b814jr1kg9o"
86+
}], {});
87+
workbox.cleanupOutdatedCaches();
88+
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
89+
allowlist: [/^\/$/]
90+
}));
91+
92+
}));

0 commit comments

Comments
 (0)