Skip to content

Commit f77ca7d

Browse files
authored
Merge pull request #91 from Easy-Ti-cket/develop
Merge develop branch to main branch
2 parents 2d5a14d + 3912d44 commit f77ca7d

File tree

200 files changed

+22989
-2433
lines changed

Some content is hidden

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

200 files changed

+22989
-2433
lines changed

.eslintcache

Lines changed: 0 additions & 1 deletion
This file was deleted.

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "easy-ticket-e7da7"
4+
}
5+
}

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
# Ensure all text files use LF
12
* text=auto
3+
*.js text eol=lf
4+
*.jsx text eol=lf
5+
*.ts text eol=lf
6+
*.tsx text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.html text eol=lf
10+
*.css text eol=lf
11+
*.scss text eol=lf
12+
*.sh text eol=lf

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 📝작업 내용
2+
3+
> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
4+
5+
## 스크린샷 (선택)
6+
7+
## 💬리뷰 요구사항
8+
9+
> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
10+
> ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

.github/workflows/develop.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: development production CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- develop # develop 브랜치에 "push"될 때 본 workflow를 실행
7+
8+
jobs:
9+
preview:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout branch # 레포지토리 소스를 runner로 가져오기
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "20" # Node.js 버전
19+
20+
- name: Export environment variables # GitHub Secrets에서 환경 변수 설정
21+
run: |
22+
echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> $GITHUB_ENV
23+
echo "VITE_AUTH_DOMAIN=${{ secrets.VITE_AUTH_DOMAIN }}" >> $GITHUB_ENV
24+
echo "VITE_PROJECT_ID=${{ secrets.VITE_PROJECT_ID }}" >> $GITHUB_ENV
25+
echo "VITE_STORAGE_BUCKET=${{ secrets.VITE_STORAGE_BUCKET }}" >> $GITHUB_ENV
26+
echo "VITE_MESSAGING_SENDER_ID=${{ secrets.VITE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV
27+
echo "VITE_APP_ID=${{ secrets.VITE_APP_ID }}" >> $GITHUB_ENV
28+
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> $GITHUB_ENV
29+
30+
- name: Build
31+
run: yarn && yarn build
32+
- name: Deploy to Firebase Hosting production channel
33+
id: firebase_hosting_production
34+
uses: FirebaseExtended/action-hosting-deploy@v0 # firebase 배포를 위한 action
35+
with:
36+
repoToken: "${{ secrets.EASY_TICKET }}" # github token
37+
firebaseServiceAccount: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" # 레포지토리 환경변수로 등록한 firebase service account
38+
channelId: live # 프로덕션 배포
39+
projectId: easy-ticket-e7da7 # FireBase 프로젝트 ID
40+
41+
- name: Check outputs
42+
run: |
43+
echo urls ${{steps.firebase_hosting_production.outputs.url}}
44+
echo expire_time ${{steps.firebase_hosting_production.outputs.expire_time}}
45+
echo details_url ${{steps.firebase_hosting_production.outputs.details_url}}

.github/workflows/main.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: production CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main # main 브랜치에 push 시 workflow 실행
7+
8+
jobs:
9+
production:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout branch # 레포지토리 소스를 runner로 가져오기
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "20" # Node.js 버전
19+
20+
- name: Export environment variables # GitHub Secrets에서 환경 변수 설정
21+
run: |
22+
echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> $GITHUB_ENV
23+
echo "VITE_AUTH_DOMAIN=${{ secrets.VITE_AUTH_DOMAIN }}" >> $GITHUB_ENV
24+
echo "VITE_PROJECT_ID=${{ secrets.VITE_PROJECT_ID }}" >> $GITHUB_ENV
25+
echo "VITE_STORAGE_BUCKET=${{ secrets.VITE_STORAGE_BUCKET }}" >> $GITHUB_ENV
26+
echo "VITE_MESSAGING_SENDER_ID=${{ secrets.VITE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV
27+
echo "VITE_APP_ID=${{ secrets.VITE_APP_ID }}" >> $GITHUB_ENV
28+
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> $GITHUB_ENV
29+
30+
- name: Build
31+
run: yarn && yarn build
32+
33+
- name: Deploy to Firebase Hosting production channel
34+
id: firebase_hosting_production
35+
uses: FirebaseExtended/action-hosting-deploy@v0 # firebase 배포를 위한 action
36+
with:
37+
repoToken: "${{ secrets.EASY_TICKET }}" # github token
38+
firebaseServiceAccount: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" # firebase service account
39+
channelId: live # 프로덕션 배포
40+
projectId: easy-ticket-e7da7 # FireBase 프로젝트 ID
41+
42+
- name: Check outputs
43+
run: |
44+
echo urls ${{steps.firebase_hosting_production.outputs.url}}
45+
echo expire_time ${{steps.firebase_hosting_production.outputs.expire_time}}
46+
echo details_url ${{steps.firebase_hosting_production.outputs.details_url}}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
.eslintcache
27+
28+
# Firebase
29+
.env
30+
.firebase

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# 스테이징된 파일에 대해 린팅 및 포맷팅
5+
npx lint-staged

.husky/pre-push

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# ESLint를 사용하여 전체 코드베이스에 대해 자동 수정
5+
npx eslint . --fix
6+
7+
# lint-staged를 실행하여 추가적인 린팅 수행
8+
npx lint-staged
9+
10+
# 전체 린팅 검사
11+
npm run lint

eslint.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@ import pluginReactRefresh from "eslint-plugin-react-refresh";
77

88
export default [
99
{
10-
files: ["**/*.{js,mjs,cjs,jsx}"],
10+
files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
1111
ignores: ["dist/**", ".eslintrc.cjs"],
1212
languageOptions: {
1313
parserOptions: {
1414
ecmaVersion: "latest",
1515
sourceType: "module",
1616
ecmaFeatures: {
17-
jsx: true,
18-
},
17+
jsx: true
18+
}
1919
},
20-
globals: globals.browser,
20+
globals: globals.browser
2121
},
2222
plugins: {
2323
react: pluginReact,
2424
"react-hooks": pluginReactHooks,
2525
prettier: pluginPrettier,
26-
"react-refresh": pluginReactRefresh,
26+
"react-refresh": pluginReactRefresh
2727
},
2828
settings: {
2929
react: {
30-
version: "18.2",
31-
},
30+
version: "18.2"
31+
}
3232
},
3333
rules: {
3434
"react/jsx-no-target-blank": "off",
3535
"react-refresh/only-export-components": [
3636
"warn",
37-
{ allowConstantExport: true },
37+
{ allowConstantExport: true }
3838
],
3939
quotes: ["error", "double"],
4040
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
41-
"prettier/prettier": ["error", prettierConfig],
42-
},
43-
},
41+
"prettier/prettier": ["error", prettierConfig]
42+
}
43+
}
4444
];

firebase-config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { initializeApp } from "firebase/app";
2+
import { getAnalytics } from "firebase/analytics";
3+
import { getFirestore } from "firebase/firestore";
4+
5+
// console.log("환경 변수 적용 테스트:", import.meta.env.VITE_API_KEY);
6+
7+
const firebaseConfig = {
8+
apiKey: import.meta.env.VITE_API_KEY,
9+
authDomain: import.meta.env.VITE_AUTH_DOMAIN,
10+
projectId: import.meta.env.VITE_PROJECT_ID,
11+
storageBucket: import.meta.env.VITE_STORAGE_BUCKET,
12+
messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID,
13+
appId: import.meta.env.VITE_APP_ID,
14+
measurementId: import.meta.env.VITE_MEASUREMENT_ID
15+
};
16+
17+
// 파이어베이스 초기화
18+
const app = initializeApp(firebaseConfig);
19+
const analytics = getAnalytics(app);
20+
export const db = getFirestore(app);

firebase.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"hosting": {
3+
"public": "dist",
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
5+
"rewrites": [
6+
{
7+
"source": "**",
8+
"destination": "/index.html"
9+
}
10+
]
11+
}
12+
}

0 commit comments

Comments
 (0)