Skip to content

Commit 59bc6ab

Browse files
authored
Merge pull request #128 from kakao-tech-campus-3rd-step3/release/2025-10-03
전남대 4팀 FE 5차 코드 리뷰
2 parents 2616fc1 + 3e06207 commit 59bc6ab

File tree

70 files changed

+2338
-731
lines changed

Some content is hidden

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

70 files changed

+2338
-731
lines changed

.eslintrc.cjs

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,85 @@ module.exports = {
1010
react: {
1111
version: 'detect',
1212
},
13+
'import/resolver': {
14+
typescript: {
15+
alwaysTryTypes: true,
16+
project: './tsconfig.json',
17+
},
18+
},
1319
},
1420
env: {
1521
browser: true,
1622
es2021: true,
1723
node: true,
1824
},
19-
plugins: ['react', 'react-hooks', 'react-refresh', '@typescript-eslint', 'prettier'],
25+
plugins: ['react', 'react-hooks', 'react-refresh', '@typescript-eslint', 'prettier', 'import'],
2026
extends: [
2127
'eslint:recommended',
2228
'plugin:@typescript-eslint/recommended',
2329
'plugin:react/recommended',
2430
'plugin:react-hooks/recommended',
2531
'plugin:prettier/recommended',
32+
'plugin:import/recommended',
2633
],
2734
rules: {
2835
'prettier/prettier': 'error',
2936
'react/react-in-jsx-scope': 'off',
3037
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
38+
'import/order': [
39+
'error',
40+
{
41+
groups: [
42+
'builtin',
43+
'external',
44+
'internal',
45+
['sibling', 'parent', 'index'],
46+
'type',
47+
'unknown',
48+
],
49+
pathGroups: [
50+
{
51+
pattern: 'react',
52+
group: 'external',
53+
position: 'before',
54+
},
55+
{
56+
pattern: 'react*',
57+
group: 'external',
58+
position: 'before',
59+
},
60+
{
61+
pattern: 'react*',
62+
group: 'external',
63+
position: 'before',
64+
},
65+
{
66+
pattern: '@emotion/styled',
67+
group: 'external',
68+
position: 'after',
69+
},
70+
{
71+
pattern: '@/hooks/*',
72+
group: 'internal',
73+
position: 'before',
74+
},
75+
{
76+
pattern: '@/components/*',
77+
group: 'internal',
78+
position: 'before',
79+
},
80+
{
81+
pattern: '@/pages/*',
82+
group: 'internal',
83+
position: 'before',
84+
},
85+
],
86+
// 'newlines-between': 'always',
87+
alphabetize: {
88+
order: 'asc',
89+
caseInsensitive: true,
90+
},
91+
},
92+
],
3193
},
3294
};

.github/workflows/fe-ci-cd.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Dongarium FE CI/CD
2+
3+
on:
4+
pull_request:
5+
branches: ['develop']
6+
push:
7+
branches: ['main']
8+
9+
jobs:
10+
install-dependencies:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '22'
20+
21+
- name: Restore node modules from cache
22+
id: restore-node-modules
23+
uses: actions/cache@v3
24+
with:
25+
path: node_modules
26+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-node
29+
30+
- name: Install dependencies
31+
if: steps.restore-node-modules.outputs.cache-hit != 'true'
32+
run: npm install
33+
34+
lint:
35+
runs-on: ubuntu-latest
36+
needs: install-dependencies
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v2
43+
with:
44+
node-version: '22'
45+
46+
- name: Restore node modules from cache
47+
id: restore-node-modules
48+
uses: actions/cache@v3
49+
with:
50+
path: node_modules
51+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
52+
restore-keys: |
53+
${{ runner.os }}-node-
54+
- name: Install dependencies (if not cached)
55+
if: steps.restore-node-modules.outputs.cache-hit != 'true'
56+
run: npm install
57+
58+
- name: Run lint
59+
run: npm run lint
60+
61+
type-check:
62+
runs-on: ubuntu-latest
63+
needs: install-dependencies
64+
steps:
65+
- uses: actions/checkout@v2
66+
- uses: actions/setup-node@v2
67+
with:
68+
node-version: '22'
69+
- name: Restore node modules from cache
70+
uses: actions/cache@v3
71+
with:
72+
path: node_modules
73+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
74+
- name: Install dependencies
75+
run: npm install
76+
- name: TypeScript type check
77+
run: npx tsc --noEmit
78+
79+
build:
80+
runs-on: ubuntu-latest
81+
needs: [install-dependencies, lint]
82+
steps:
83+
- name: Checkout repository
84+
uses: actions/checkout@v2
85+
86+
- name: Set up Node.js
87+
uses: actions/setup-node@v2
88+
with:
89+
node-version: '22'
90+
91+
- name: Restore node modules from cache
92+
id: restore-node-modules
93+
uses: actions/cache@v3
94+
with:
95+
path: node_modules
96+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
97+
restore-keys: |
98+
${{ runner.os }}-node-
99+
- name: Install dependencies (if not cached)
100+
if: steps.restore-node-modules.outputs.cache-hit != 'true'
101+
run: npm install
102+
103+
- name: Run Build
104+
env:
105+
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}
106+
run: npm run build
107+
108+
- name: Upload dist as artifact
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: react-dist
112+
path: ./dist
113+
114+
deploy:
115+
runs-on: ubuntu-latest
116+
needs: build
117+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
118+
environment: dongarium
119+
steps:
120+
- name: Download build artifact
121+
uses: actions/download-artifact@v4
122+
with:
123+
name: react-dist
124+
path: ./dist
125+
126+
- name: Configure AWS credentials
127+
uses: aws-actions/configure-aws-credentials@v2
128+
with:
129+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
130+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
131+
aws-region: ap-northeast-2
132+
133+
- name: Deploy to S3 and invalidate CloudFront
134+
run: |
135+
aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }} --delete --acl public-read
136+
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"

0 commit comments

Comments
 (0)