Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST PR #16

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/back-release-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: backEnd API server CI/CD
on:
pull_request:
branches: [BE/release]
jobs:
api-server-ci:
runs-on: ubuntu-20.04
steps:
- name: ✅ 코드 체크아웃
uses: actions/checkout@v3

- name : 👻 노드 설정
uses : actions/setup-node@v3
with:
node-version: '20'

- name : ⚒️ pm2 설치
run: npm i pm2 -g

- name : 🔐 env 설정
run: |
echo "WEB_HOOK_URL=${{secrets.WEB_HOOK_URL}}" >> .env
echo "PORT=${{secrets.PORT}}" >> .env
echo "DB_HOST=${{secrets.DB_HOST}}" >> .env
echo "DB_PORT=${{secrets.DB_PORT}}" >> .env
echo "DB_USERNAME=${{secrets.DB_USERNAME}}" >> .env
echo "DB_PASSWORD=${{secrets.DB_PASSWORD}}" >> .env
echo "DB_DATABASE=${{secrets.DB_DATABASE}}" >> .env
echo "SYNCHRONIZED=${{secrets.SYNCHRONIZED}}" >> .env

- name: ⬇️ 의존성 설치
working-directory: ./backEnd/api
run: npm install

- name: ✅ 유닛 테스트
working-directory: ./backEnd/api
run: npm test

- name: 📦 프로젝트 빌드
working-directory: ./backEnd/api
run: npm run build

# - name: 🐳 도커 로그인
# uses: docker/login-action@v1
# with:
# username: ${{secrets.DOCKER_USERNAME}}
# password: ${{secrets.DOCKER_TOKEN}}

- name: ⬆️ Docker Image Build
working-directory: ./backEnd/api
run: |
docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_
PASSWORD}}
docker build -t ${{secrets.DOCKER_USERNAME}}/api .
docker push ${{secrets.DOCKER_USERNAME}}/api

- name: 🏃‍♂️ Deploy
uses: appleboy/[email protected]
with:
host: ${{secrets.API_HOST}}
username: ${{secrets.API_USERNAME}}
password: ${{secrets.API_PASSWORD}}
port: ${{secrets.API_PORT}}
script: sh deploy.sh
35 changes: 35 additions & 0 deletions .github/workflows/front-release-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: frontEnd test deploy
on:
pull_request:
branches: FE/release
jobs:
build-test-deploy:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.16.0]
steps:
- name: ✅ 코드 체크아웃
uses: actions/checkout@v3

- name: ⬇️ 의존성 설치
working-directory: ./frontEnd
run: npm install

- name: ✅ 유닛 테스트
working-directory: ./frontEnd
run: npm test

- name: 📦 프로젝트 빌드
working-directory: ./frontEnd
run: npm run build

- name: ⬆️ Object Storage 업로드
working-directory: ./frontEnd
env:
AWS_ACCESS_KEY_ID: '${{secrets.AWS_ACCESS_KEY_ID}}'
AWS_SECRET_ACCESS_KEY: '${{secrets.AWS_SECRET_ACCESS_KEY}}'
AWS_DEFAULT_REGION: '${{secrets.AWS_DEFAULT_REGION}}'
run: |
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp --recursive dist s3://algoitni
10 changes: 10 additions & 0 deletions backEnd/api/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:20.3.1-alpine3.18
WORKDIR /home/app

COPY . .
RUN npm i -g pm2
RUN npm install

EXPOSE 4000

CMD ["pm2-runtime", "dist/main.js", "-i", "max"]
1 change: 1 addition & 0 deletions backEnd/api/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo "deploy flow"g
28 changes: 22 additions & 6 deletions frontEnd/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended'],
ignorePatterns: ['dist', '.eslintrc.cjs'],
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['react', '@typescript-eslint', 'prettier'],
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'react/react-in-jsx-scope': 'off',
},
};
3 changes: 2 additions & 1 deletion frontEnd/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 140
"printWidth": 140,
"endOfLine": "auto"
}
Loading