Skip to content

Commit

Permalink
Merge branch 'release' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoi96 authored Dec 2, 2022
2 parents 46a1aa2 + 419cfb5 commit 163ab09
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
Dockerfile
.git
.gitignore
.dockerignore
21 changes: 21 additions & 0 deletions .github/workflows/release-autopull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release-autopull
on:
push:
branches: release

jobs:
distribute:
name: distribute
runs-on: ubuntu-latest
steps:
- name: git pull and restart docker
uses: appleboy/ssh-action@master
with:
host: ${{secrets.REMOTE_IP}}
username: ${{secrets.REMOTE_SSH_ID}}
password: ${{secrets.REMOTE_PASSWORD}}
port: ${{secrets.REMOTE_SSH_PORT}}
script: |
cd /root/runwithme
git pull https://github.com/boostcampwm-2022/WEB26-RunWithMe.git release
docker-compose down && docker-compose build --no-cache && docker-compose up -d
79 changes: 79 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: build + eslint check

on:
pull_request:
branches:
- release

jobs:
check:
name: check
runs-on: ubuntu-latest
outputs:
client: ${{steps.filter.outputs.client}}
server: ${{steps.filter.outputs.server}}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
client:
- 'client/**'
server:
- 'server/**'
client:
needs: check
if: ${{needs.check.outputs.client=='true'}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Nodejs Setup
uses: actions/setup-node@v2

- name: Cache client node modules
id: cache-client
uses: actions/cache@v3
with:
path: client/node_modules
key: npm-packages-client-${{hashFiles('**/package-lock.json')}}

- name: Install client dependencies
if: ${{steps.cache-client.outputs.cache-hit != 'true'}}
run: cd client && npm install

- name: Client eslint check
run: ./client/node_modules/.bin/eslint client/src --ext .ts,.tsx

- name: Run client build check
run: cd client && npm run build

server:
needs: check
if: ${{needs.check.outputs.server=='true'}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Nodejs Setup
uses: actions/setup-node@v2

- name: Cache server node modules
id: cache-server
uses: actions/cache@v3
with:
path: server/node_modules
key: npm-packages-server-${{hashFiles('**/package-lock.json')}}

- name: Install server dependencies
if: ${{steps.cache-server.outputs.cache-hit != 'true'}}
run: cd server && npm install

- name: server eslint check
run: ./server/node_modules/.bin/eslint server/src --ext .ts,.tsx

- name: Run server build check
run: cd server && npm run build
15 changes: 15 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:latest

WORKDIR /usr/src/app

COPY . ./

WORKDIR /usr/src/app/client
RUN npm install
RUN npm run build

WORKDIR /usr/src/app/server
RUN npm install
RUN npm run build

EXPOSE 4000
1 change: 0 additions & 1 deletion client/src/pages/NewCourse/NewCourse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const NewCourse = () => {
const { lng: x, lat: y } = getLatLngByXY(path[0]);
const regions = await query({ x, y });
// [0]: BCode, [1]: HCode

const { code: hCode } = regions.documents[1];
const response: any = await post("/course", {
title,
Expand Down
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3.8"

services:
runwithme:
build:
context: .
dockerfile: Dockerfile.prod
container_name: runwithme
ports:
- "4000:4000"
command: npm run start
networks:
- webnet
depends_on:
- redis

redis:
container_name: redis
image: redis:5
command: redis-server
networks:
- webnet
ports:
- "6379:6379"

networks:
webnet:

0 comments on commit 163ab09

Please sign in to comment.