Skip to content

Commit

Permalink
Merge pull request #557 from jiphyeonjeon-42/develop
Browse files Browse the repository at this point in the history
feat!: Tag && Type
  • Loading branch information
jimin52 authored Jul 9, 2023
2 parents f2ac14e + 39c8e44 commit d7e0fd8
Show file tree
Hide file tree
Showing 90 changed files with 3,923 additions and 9,934 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Deploy to Amazon EC2

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -12,7 +13,7 @@ env:
S3_BUCKET_NAME: jipbackdeploy
CODE_DEPLOY_APPLICATION_NAME: newjiphyeonjeon
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: deploy

jobs:
deploy:
name: Deploy
Expand Down Expand Up @@ -45,30 +46,33 @@ jobs:
- name: setup node.js
uses: actions/setup-node@master
with:
node-version: 16.x
node-version: 18.x

- name: setup pnpm
uses: pnpm/action-setup@v2

- name: install dependencies
run: |
cd backend && yarn install
cd backend && pnpm install
- name: build file
run: |
cd backend && yarn build
cd backend && pnpm build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload to AWS S3
run: |
aws deploy push \
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \
--s3-location s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip \
--source .
- name: Deploy to AWS EC2 from S3
run: |
aws deploy create-deployment \
Expand Down
9 changes: 6 additions & 3 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"es2021": true,
"jest": true
},
"extends": ["airbnb-base"],
"root": true,
"extends": ["airbnb-base", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"import/extensions": [
"error",
Expand All @@ -21,7 +22,9 @@
"json": "never"
}
],
"linebreak-style": "off"
"linebreak-style": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error"
},
"settings": {
"import/resolver": {
Expand Down
13 changes: 10 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
FROM node:16
FROM node:18-alpine
# https://github.com/pnpm/pnpm/issues/4495#issuecomment-1317831712
ENV PNPM_HOME="/root/.local/share/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"
RUN npm install --global pnpm

COPY . .
RUN yarn
RUN pnpm install

ENTRYPOINT [ "sh", "start.sh"]
RUN pnpm install --global pm2
RUN pm2-runtime --version || exit 1

ENTRYPOINT [ "sh", "start.sh"]
52 changes: 28 additions & 24 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,43 @@
"repository": "https://github.com/jiphyeonjeon-42/backend-express.git",
"author": "jolim, chanykim, tkim, jimin, wocho, seongyle, seunam",
"license": "MIT",
"engines": {
"node": ">=20.3.1 || >=18.16.1 <20.0.0"
},
"scripts": {
"start": "node dist/server.js",
"build": "npx tsc -p .",
"build": "npx tsc -p ./tsconfig.prod.json",
"dev": "nodemon --watch \"src/**/*.ts\" --exec \"ts-node\" src/server.ts",
"prod": "npx tsc -p . && yarn start",
"prod": "npx tsc -p ./tsconfig.prod.json && npm start",
"lint": "eslint --fix --ext .js,.ts src",
"test": "jest"
},
"devDependencies": {
"@types/bcrypt": "^5.0.0",
"@types/cookie-parser": "^1.4.2",
"@types/cookie-parser": "^1.4.3",
"@types/cors": "^2.8.13",
"@types/dotenv": "^8.2.0",
"@types/express": "^4.17.13",
"@types/http-errors": "^1.8.2",
"@types/jest": "^27.4.1",
"@types/jsonwebtoken": "^9.0.1",
"@types/morgan": "^1.9.3",
"@types/node": "^17.0.15",
"@types/express": "^4.17.17",
"@types/http-errors": "^2.0.1",
"@types/jest": "^29.5.2",
"@types/jsonwebtoken": "^9.0.2",
"@types/morgan": "^1.9.4",
"@types/node": "^18.16.1",
"@types/node-schedule": "^2.1.0",
"@types/passport": "^1.0.7",
"@types/passport-jwt": "^3.0.6",
"@types/passport": "^1.0.12",
"@types/passport-jwt": "^3.0.8",
"@types/swagger-jsdoc": "^6.0.1",
"@types/swagger-ui-express": "^4.1.3",
"@types/winston": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"eslint": "^7.32.0",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"eslint": "^8.43.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.4",
"jest": "^27.5.1",
"nodemon": "^2.0.15",
"prettier": "^2.5.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.4.0",
"typescript": "^4.5.5"
"eslint-plugin-import": "^2.27.5",
"jest": "^29.5.0",
"nodemon": "^2.0.22",
"prettier": "^2.8.8",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "5.0.4"
},
"dependencies": {
"@slack/web-api": "^6.7.1",
Expand All @@ -53,6 +55,7 @@
"express": "^4.17.2",
"http-errors": "^2.0.0",
"http-status": "^1.5.0",
"http-terminator": "^3.2.0",
"inversify": "^6.0.1",
"jest-mock-extended": "^3.0.4",
"jsonwebtoken": "^8.5.1",
Expand All @@ -71,6 +74,7 @@
"typeorm": "^0.3.11",
"typeorm-model-generator": "^0.4.6",
"winston": "^3.6.0",
"winston-daily-rotate-file": "^4.6.1"
"winston-daily-rotate-file": "^4.6.1",
"zod": "^3.21.4"
}
}
Loading

0 comments on commit d7e0fd8

Please sign in to comment.