diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md index 0da94fd..af13453 100644 --- a/.github/ISSUE_TEMPLATE/issue-template.md +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -1,11 +1,10 @@ --- name: Issue Template about: 이슈를 생성할 때 사용해주세요. -title: "[type] " +title: '[type] ' labels: '' assignees: '' type: Feature - --- ## 📄 이슈 설명 diff --git a/.github/workflows/front-deploy.yml b/.github/workflows/front-deploy.yml new file mode 100644 index 0000000..7186afb --- /dev/null +++ b/.github/workflows/front-deploy.yml @@ -0,0 +1,42 @@ +name: Frontend Deploy + +on: + push: + branches: [main] +# main에 머지(push)될 때 실행 + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: corepack enable + # package.json의 packageManager 버전(yarn berry)으로 자동 전환 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - run: yarn install --immutable + - run: yarn build + # dist/ 폴더 생성 + + - uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + # GitHub Secrets에 저장한 AWS 키로 인증 + + - name: S3 업로드 + run: aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete + # dist/ 폴더를 S3에 동기화 + # --delete: S3에만 있고 dist/에 없는 파일은 삭제 (이전 빌드 파일 정리) + + - name: CloudFront 캐시 무효화 + run: | + aws cloudfront create-invalidation \ + --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \ + --paths "/*" + # 전체 캐시 무효화 → 사용자가 새 빌드 파일을 즉시 받을 수 있게 diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml new file mode 100644 index 0000000..e4daaea --- /dev/null +++ b/.github/workflows/pr-ci.yml @@ -0,0 +1,38 @@ +name: PR CI +# GitHub Actions 탭에 표시되는 이름 + +on: + pull_request: +# base branch 제한 없이 PR이면 CI 수행 + +jobs: + check: + runs-on: ubuntu-latest + # GitHub이 제공하는 우분투 서버에서 실행 + steps: + - uses: actions/checkout@v4 + # 레포 코드를 서버에 내려받기 + + - run: corepack enable + # package.json의 packageManager 버전(yarn berry)으로 자동 전환 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + # Node.js 22 설치, yarn 캐시 활성화 (두 번째 실행부터 빠름) + + - run: yarn install --immutable + # yarn.lock 기준으로 설치, lock 파일 변경 불가 (CI 안전장치) + + - run: yarn lint + # ESLint 검사 (console.log 등 룰 위반 시 실패) + + - run: yarn format:check + # Prettier 포맷 검사 (포맷 안 맞으면 실패) + + - run: yarn build + # TypeScript 타입체크 + Vite 빌드 (둘 중 하나라도 실패하면 머지 불가) + + # - run: yarn test + # 테스트 추가되면 활성화 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..7e812fd --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist +.yarn +.pnp.cjs +.pnp.loader.mjs diff --git a/eslint.config.js b/eslint.config.js index 1b51e9a..b648385 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint'; import { defineConfig, globalIgnores } from 'eslint/config'; export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(['dist', '.yarn/', '.pnp.cjs', '.pnp.loader.mjs']), { files: ['**/*.{ts,tsx}'], extends: [ diff --git a/package.json b/package.json index 75b0bff..4e6611c 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", + "format:check": "prettier --check .", "preview": "vite preview", "prepare": "husky" },