Skip to content

Commit

Permalink
0.1.0 배포
Browse files Browse the repository at this point in the history
  • Loading branch information
doputer authored Nov 30, 2022
2 parents 928b518 + d9589df commit 614a8f2
Show file tree
Hide file tree
Showing 183 changed files with 24,353 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/codeowners
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@doputer @dahyeon405 @MinHK4 @parkhyeonki
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## 개요



## 변경 사항

-

## 참고 사항

-

## 스크린샷



## 관련 이슈

-
38 changes: 38 additions & 0 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Backend CD

on:
push:
branches: [main]
paths:
- 'backend/**'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Generate Environment Variables
run: |
echo "$BACKEND_ENV" >> .env.production
env:
CI: false
BACKEND_ENV: '${{ secrets.BACKEND_ENV }}'

- name: Transfer Environment Variables with SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: '.env.production'
target: 'knoticle/backend/env'

- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: ${{ secrets.SSH_BACKEND_SCRIPT }}
38 changes: 38 additions & 0 deletions .github/workflows/frontend-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Frontend CD

on:
push:
branches: [main]
paths:
- 'frontend/**'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Generate Environment Variables
run: |
echo "$FRONTEND_ENV" >> .env.production
env:
CI: false
FRONTEND_ENV: '${{ secrets.FRONTEND_ENV }}'

- name: Transfer Environment Variables with SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: '.env.production'
target: 'knoticle/frontend'

- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: ${{ secrets.SSH_FRONTEND_SCRIPT }}
123 changes: 123 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Frontend CI

on:
pull_request:
branches: [main, develop]
paths:
- 'frontend/**'

jobs:
lint:
name: Lint CI

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Dependencies
uses: actions/cache@v3
id: frontend-cache
with:
path: frontend/node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- if: ${{ steps.frontend-cache.outputs.cache-hit != 'true' }}
name: Install Dependencies
run: npm install
working-directory: frontend

- name: Check Lint
run: npm run lint
env:
CI: true
working-directory: frontend

lighthouse:
name: Lighthouse CI

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Dependencies
uses: actions/cache@v3
id: frontend-cache
with:
path: frontend/node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- if: ${{ steps.frontend-cache.outputs.cache-hit != 'true' }}
name: Install Dependencies
run: npm install
working-directory: frontend

- name: Build
run: npm run build
working-directory: frontend

- name: Run Lighthouse CI
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
run: |
npm install -g @lhci/cli
lhci autorun
working-directory: frontend

- name: Format Lighthouse Score
id: format_lighthouse_score
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('frontend/lighthouse_reports/manifest.json'));
const summaryTotal = {};
results.forEach((result) => {
const { summary } = result;
const formatResult = (res) => Math.round(res * 100);
Object.keys(summary).forEach((key) => {
if (key in summaryTotal) summaryTotal[key] += formatResult(summary[key]);
else summaryTotal[key] = formatResult(summary[key]);
});
});
Object.keys(summaryTotal).forEach((key) => {
summaryTotal[key] = Math.round(summaryTotal[key] / results.length);
});
const score = (res) => (res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴');
const comment = [
`⚡️ Lighthouse report!`,
`| Category | Score |`,
`| --- | --- |`,
`| ${score(summaryTotal.performance)} Performance | ${summaryTotal.performance} |`,
`| ${score(summaryTotal.accessibility)} Accessibility | ${summaryTotal.accessibility} |`,
`| ${score(summaryTotal['best-practices'])} Best Practices | ${summaryTotal['best-practices']} |`,
`| ${score(summaryTotal.seo)} SEO | ${summaryTotal.seo} |`,
`| ${score(summaryTotal.pwa)} PWA | ${summaryTotal.pwa} |`,
].join('\n');
core.setOutput('comment', comment)
- name: Comment Lighthouse Report
uses: unsplash/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: ${{ steps.format_lighthouse_score.outputs.comment}}
Empty file added README.md
Empty file.
59 changes: 59 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
pathGroups: [
{
pattern: '{express*,express*/**}',
group: 'builtin',
position: 'before',
},
],
pathGroupsExcludedImportTypes: [],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
project: 'backend/tsconfig.json',
},
},
},
};
5 changes: 5 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
/dist
/env
.env
/prisma/migrations
13 changes: 13 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"quoteProps": "as-needed",
"trailingComma": "es5",
"arrowParens": "always",
"endOfLine": "lf",
"bracketSpacing": true,
"proseWrap": "preserve"
}
Loading

0 comments on commit 614a8f2

Please sign in to comment.