Skip to content

Commit

Permalink
Merge pull request #91 from Easy-Ti-cket/develop
Browse files Browse the repository at this point in the history
Merge develop branch to main branch
  • Loading branch information
abyss-s authored Sep 8, 2024
2 parents 2d5a14d + 3912d44 commit f77ca7d
Show file tree
Hide file tree
Showing 200 changed files with 22,989 additions and 2,433 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "easy-ticket-e7da7"
}
}
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# Ensure all text files use LF
* text=auto
*.js text eol=lf
*.jsx text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.md text eol=lf
*.html text eol=lf
*.css text eol=lf
*.scss text eol=lf
*.sh text eol=lf
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 📝작업 내용

> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
## 스크린샷 (선택)

## 💬리뷰 요구사항

> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
> ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?
45 changes: 45 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: development production CI/CD

on:
push:
branches:
- develop # develop 브랜치에 "push"될 때 본 workflow를 실행

jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout branch # 레포지토리 소스를 runner로 가져오기
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20" # Node.js 버전

- name: Export environment variables # GitHub Secrets에서 환경 변수 설정
run: |
echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> $GITHUB_ENV
echo "VITE_AUTH_DOMAIN=${{ secrets.VITE_AUTH_DOMAIN }}" >> $GITHUB_ENV
echo "VITE_PROJECT_ID=${{ secrets.VITE_PROJECT_ID }}" >> $GITHUB_ENV
echo "VITE_STORAGE_BUCKET=${{ secrets.VITE_STORAGE_BUCKET }}" >> $GITHUB_ENV
echo "VITE_MESSAGING_SENDER_ID=${{ secrets.VITE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV
echo "VITE_APP_ID=${{ secrets.VITE_APP_ID }}" >> $GITHUB_ENV
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> $GITHUB_ENV
- name: Build
run: yarn && yarn build
- name: Deploy to Firebase Hosting production channel
id: firebase_hosting_production
uses: FirebaseExtended/action-hosting-deploy@v0 # firebase 배포를 위한 action
with:
repoToken: "${{ secrets.EASY_TICKET }}" # github token
firebaseServiceAccount: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" # 레포지토리 환경변수로 등록한 firebase service account
channelId: live # 프로덕션 배포
projectId: easy-ticket-e7da7 # FireBase 프로젝트 ID

- name: Check outputs
run: |
echo urls ${{steps.firebase_hosting_production.outputs.url}}
echo expire_time ${{steps.firebase_hosting_production.outputs.expire_time}}
echo details_url ${{steps.firebase_hosting_production.outputs.details_url}}
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: production CI/CD

on:
push:
branches:
- main # main 브랜치에 push 시 workflow 실행

jobs:
production:
runs-on: ubuntu-latest
steps:
- name: Checkout branch # 레포지토리 소스를 runner로 가져오기
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20" # Node.js 버전

- name: Export environment variables # GitHub Secrets에서 환경 변수 설정
run: |
echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> $GITHUB_ENV
echo "VITE_AUTH_DOMAIN=${{ secrets.VITE_AUTH_DOMAIN }}" >> $GITHUB_ENV
echo "VITE_PROJECT_ID=${{ secrets.VITE_PROJECT_ID }}" >> $GITHUB_ENV
echo "VITE_STORAGE_BUCKET=${{ secrets.VITE_STORAGE_BUCKET }}" >> $GITHUB_ENV
echo "VITE_MESSAGING_SENDER_ID=${{ secrets.VITE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV
echo "VITE_APP_ID=${{ secrets.VITE_APP_ID }}" >> $GITHUB_ENV
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> $GITHUB_ENV
- name: Build
run: yarn && yarn build

- name: Deploy to Firebase Hosting production channel
id: firebase_hosting_production
uses: FirebaseExtended/action-hosting-deploy@v0 # firebase 배포를 위한 action
with:
repoToken: "${{ secrets.EASY_TICKET }}" # github token
firebaseServiceAccount: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" # firebase service account
channelId: live # 프로덕션 배포
projectId: easy-ticket-e7da7 # FireBase 프로젝트 ID

- name: Check outputs
run: |
echo urls ${{steps.firebase_hosting_production.outputs.url}}
echo expire_time ${{steps.firebase_hosting_production.outputs.expire_time}}
echo details_url ${{steps.firebase_hosting_production.outputs.details_url}}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.eslintcache

# Firebase
.env
.firebase
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# 스테이징된 파일에 대해 린팅 및 포맷팅
npx lint-staged
11 changes: 11 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# ESLint를 사용하여 전체 코드베이스에 대해 자동 수정
npx eslint . --fix

# lint-staged를 실행하여 추가적인 린팅 수행
npx lint-staged

# 전체 린팅 검사
npm run lint
22 changes: 11 additions & 11 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@ import pluginReactRefresh from "eslint-plugin-react-refresh";

export default [
{
files: ["**/*.{js,mjs,cjs,jsx}"],
files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
ignores: ["dist/**", ".eslintrc.cjs"],
languageOptions: {
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
jsx: true
}
},
globals: globals.browser,
globals: globals.browser
},
plugins: {
react: pluginReact,
"react-hooks": pluginReactHooks,
prettier: pluginPrettier,
"react-refresh": pluginReactRefresh,
"react-refresh": pluginReactRefresh
},
settings: {
react: {
version: "18.2",
},
version: "18.2"
}
},
rules: {
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
{ allowConstantExport: true }
],
quotes: ["error", "double"],
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
"prettier/prettier": ["error", prettierConfig],
},
},
"prettier/prettier": ["error", prettierConfig]
}
}
];
20 changes: 20 additions & 0 deletions firebase-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getFirestore } from "firebase/firestore";

// console.log("환경 변수 적용 테스트:", import.meta.env.VITE_API_KEY);

const firebaseConfig = {
apiKey: import.meta.env.VITE_API_KEY,
authDomain: import.meta.env.VITE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_PROJECT_ID,
storageBucket: import.meta.env.VITE_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID,
appId: import.meta.env.VITE_APP_ID,
measurementId: import.meta.env.VITE_MEASUREMENT_ID
};

// 파이어베이스 초기화
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
export const db = getFirestore(app);
12 changes: 12 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Loading

0 comments on commit f77ca7d

Please sign in to comment.