Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…chumjuchum into feature/#98
  • Loading branch information
xjfcnfw3 committed Nov 18, 2024
2 parents 368401c + 12126c9 commit d6afa45
Show file tree
Hide file tree
Showing 114 changed files with 4,584 additions and 352 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/close-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Close Related Issue on Merge

on:
pull_request:
types: [closed]
branches: [dev-be, dev-fe]

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Close related issue
if: ${{ github.event.pull_request.merged == true }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ISSUE_NUMBERS=$(echo "${{ github.event.pull_request.body }}" | grep -o -E '([cC]lose #[0-9]+)' | grep -o '[0-9]\+')
for ISSUE_NUMBER in $ISSUE_NUMBERS; do
echo "Closing issue #$ISSUE_NUMBER"
curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER \
-d '{"state": "closed"}'
done
6 changes: 3 additions & 3 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push backend Docker image
- name: Build and push frontend Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/backend:latest -f packages/backend/Dockerfile .
docker push ${{ secrets.DOCKER_USERNAME }}/backend:latest
docker build -t ${{ secrets.DOCKER_USERNAME }}/frontend:latest -f packages/frontend/Dockerfile .
docker push ${{ secrets.DOCKER_USERNAME }}/frontend:latest
- name: Deploy to server
uses: appleboy/[email protected]
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: storybook deploy

on:
push:
branches: ['dev-fe']

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

steps:
- name: Use repository source
uses: actions/checkout@v3

- name: Use node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
if: steps.cache.outputs.cache-hit != 'true'

- name: Set PUBLIC_URL
run: |
PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//')
echo PUBLIC_URL=$PUBLIC_URL > .env
- name: Build storybook
run: |
yarn client build-storybook
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/frontend/storybook-static
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .husky/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx eslint --fix
npx eslint --fix
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"printWidth": 80,
"bracketSpacing": true,
"endOfLine": "lf",
"useTabs": false
"useTabs": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
5 changes: 5 additions & 0 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ WORKDIR /packages
COPY . .
RUN yarn install --frozen-lockfile
RUN yarn workspace backend build

# 한국 시간에 맞춰 변경
RUN apk add --no-cache tzdata
RUN cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime && echo "Asia/Seoul" > /etc/timezone

EXPOSE 3000
CMD ["yarn", "workspace", "backend", "start:prod"]
1 change: 1 addition & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/platform-socket.io": "^10.4.7",
"@nestjs/schedule": "^4.1.1",
"@nestjs/swagger": "^8.0.5",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.4.7",
Expand Down
9 changes: 7 additions & 2 deletions packages/backend/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ScheduleModule } from '@nestjs/schedule';
import { TypeOrmModule } from '@nestjs/typeorm';
import { WinstonModule } from 'nest-winston';
import { ScraperModule } from './scraper/scraper.module';
import { AuthModule } from '@/auth/auth.module';
import { SessionModule } from '@/auth/session.module';
import { ChatModule } from '@/chat/chat.module';
Expand All @@ -14,8 +17,9 @@ import { UserModule } from '@/user/user.module';

@Module({
imports: [
//OpenapiScraperModule,
//StockPriceModule,
ConfigModule.forRoot({ cache: true, isGlobal: true }),
ScheduleModule.forRoot(),
ScraperModule,
StockModule,
UserModule,
TypeOrmModule.forRoot(
Expand All @@ -27,6 +31,7 @@ import { UserModule } from '@/user/user.module';
AuthModule,
ChatModule,
SessionModule,
ScraperModule,
],
controllers: [],
providers: [],
Expand Down
4 changes: 3 additions & 1 deletion packages/backend/src/configs/devTypeormConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ export const typeormDevelopConfig: TypeOrmModuleOptions = {
password: process.env.DB_PASS,
database: process.env.DB_NAME,
entities: [__dirname + '/../**/*.entity.{js,ts}'],
logging: true,
//logging: true,
synchronize: true,
};

2 changes: 2 additions & 0 deletions packages/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { useSwagger } from '@/configs/swagger.config';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const store = app.get(MEMORY_STORE);

app.setGlobalPrefix('api');
app.use(session({ ...sessionConfig, store }));
app.useGlobalPipes(new ValidationPipe({ transform: true }));
useSwagger(app);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d6afa45

Please sign in to comment.