Skip to content

Commit aef0a0b

Browse files
authored
Merge pull request #177 from sparcs-kaist/release/0.2.0
2 parents 89690b0 + 605d8fb commit aef0a0b

File tree

364 files changed

+16133
-21301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+16133
-21301
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea
2+
.git
3+
.gitignore
4+
.dockerignore
5+
Dockerfile
6+
*.md
7+
*.sh
8+
node_modules

.eslintrc

Lines changed: 22 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,28 @@
11
{
2-
"extends": [
3-
"airbnb-base",
4-
"airbnb/rules/react",
5-
],
6-
"plugins": [
7-
"@typescript-eslint",
8-
"simple-import-sort"
9-
],
10-
"parser": "@typescript-eslint/parser",
11-
"parserOptions": {
12-
"ecmaVersion": 2018,
13-
"sourceType": "module"
14-
},
15-
"rules": {
16-
"react/prefer-stateless-function": 0,
17-
"react/jsx-filename-extension": 0,
18-
"react/jsx-one-expression-per-line": 0,
19-
"react/jsx-props-no-spreading": 0,
20-
"react/state-in-constructor": "off",
21-
"react/destructuring-assignment": "warn",
22-
"react/no-unused-state": "warn",
23-
"react/button-has-type": "warn",
24-
"react/no-array-index-key": "warn",
25-
"react/sort-comp": "off",
26-
"react/prop-types": "warn",
27-
"react/require-default-props": "warn",
28-
"import/prefer-default-export": "warn",
29-
"import/named": "warn",
30-
"import/no-named-as-default": "off",
31-
"import/extensions": [
32-
"error",
33-
"ignorePackages",
34-
{
35-
"js": "never",
36-
"jsx": "never",
37-
"ts": "never",
38-
"tsx": "never"
39-
}
40-
],
41-
"@typescript-eslint/type-annotation-spacing": ["warn", { "before": false, "after": true, "overrides": { "colon": { "before": true, "after": true }, "arrow": { "before": true, "after": true } } }],
42-
"arrow-parens": ["warn", "as-needed"],
43-
"no-nested-ternary": "off",
44-
"no-unused-expressions": "off",
45-
"no-unused-vars": "off",
46-
"@typescript-eslint/no-unused-vars": "off",
47-
"no-useless-constructor": "off",
48-
"@typescript-eslint/no-useless-constructor": "warn",
49-
"space-before-function-paren": ["warn", "always"],
50-
"no-spaced-func": "off",
51-
"func-call-spacing": ["warn", "always"],
52-
"no-underscore-dangle": "off",
53-
"no-mixed-spaces-and-tabs": "error",
54-
"no-shadow": "warn",
55-
"max-len": ["warn", 150],
56-
"no-console": ["warn", { "allow": ["warn", "error"] }],
57-
"func-names": "off",
58-
"no-plusplus": ["warn", {
59-
"allowForLoopAfterthoughts": true
60-
}],
61-
"no-trailing-spaces": "warn",
62-
"indent": ["warn", 2],
63-
"semi": ["warn", "always"],
64-
"no-param-reassign": ["warn", { "props": true, "ignorePropertyModificationsFor": ["draft"] }],
65-
"simple-import-sort/sort": [
66-
1,
67-
{
68-
"groups": [
69-
["^\\u0000"],
70-
[
71-
"^react$",
72-
"^prop-types$",
73-
"^react-router-dom$",
74-
"^react-redux$",
75-
"^react",
76-
"^styled-components$",
77-
"^[^.]"
78-
],
79-
[
80-
"^containers",
81-
"^components",
82-
"^atoms",
83-
"^molecules",
84-
"^organisms",
85-
"^templates",
86-
"^pages"
87-
],
88-
[
89-
"^store",
90-
"^hoc",
91-
"^hooks",
92-
"^lib"
93-
],
94-
[
95-
"^(static)",
96-
"^(?!(assets|static)($|/))\\w"
97-
],
98-
["^\\."]
99-
]
100-
}
101-
]
2+
"settings": {
3+
"react": {
4+
"version": "detect"
5+
}
1026
},
1037
"env": {
104-
"browser": true
8+
"browser": true,
9+
"node": true,
10+
"jest": true
10511
},
106-
"settings": {
107-
"import/resolver": {
108-
"node": {
109-
"moduleDirectory": ["node_modules", "src", "src/components"],
110-
"extensions": [".js",".jsx",".ts",".tsx"]
111-
}
112-
},
113-
"import/extensions": [".js",".jsx",".ts",".tsx"],
114-
"import/parsers": {
115-
"@typescript-eslint/parser": [".ts",".tsx"]
116-
}
12+
"extends": [
13+
"eslint:recommended",
14+
"plugin:react/recommended",
15+
"plugin:react-hooks/recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"plugin:import/typescript",
18+
"prettier"
19+
],
20+
"rules": {
21+
"react/prop-types": "warn"
11722
},
118-
"overrides": [
119-
{
120-
"files": ["*.stories.js", "*.test.js"],
121-
"rules": {
122-
"import/no-extraneous-dependencies": "off",
123-
}
124-
},
125-
{
126-
"files": ["*.test.js"],
127-
"env": {
128-
"jest": true
129-
}
130-
}
131-
]
23+
"parser": "@typescript-eslint/parser",
24+
"root": true,
25+
"parserOptions": {
26+
"project": "./tsconfig.json"
27+
}
13228
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[Bug] Bug title"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
# Describe the bug
11+
12+
<!-- 버그가 발생한 상황을 간결하고 명확하게 설명해주세요. 버그가 발생한 원인을 추측하실 수 있다면, 같이 써주셔도 좋습니다. -->
13+
14+
A clear and concise description of what the bug is.
15+
16+
# To Reproduce
17+
18+
<!-- 버그를 재현할 수 있는 과정을 단계별로 설명해주세요. -->
19+
20+
Steps to reproduce the behavior:
21+
22+
1. Go to '...'
23+
2. Click on '....'
24+
3. Scroll down to '....'
25+
4. See error
26+
27+
# Screenshots
28+
29+
<!-- 스크린샷이나 영상이 버그 설명에 도움이 된다면, 함께 첨부해주시면 감사하겠습니다. -->
30+
31+
If applicable, add screenshots to help explain your problem.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: issue title
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
# Summary <!-- 간단한 요약. -->
11+
12+
It implements ...
13+
14+
# Tasks <!-- 해야 할 태스크 체크리스트로 만들기 -->
15+
16+
- [ ] Task 1
17+
- [ ] Task 2
18+
- [ ] Task 3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Summary <!-- 이슈에 대한 간단한 요약. -->
2+
3+
It implements ...
4+
5+
# Tasks <!-- 해야 할 태스크 체크리스트로 만들기 -->
6+
7+
- [ ] Task 1
8+
- [ ] Task 2
9+
- [ ] Task 3

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Summary <!-- PR 내용에 대한 간단한 요약 및 닫는 이슈 번호 표기. -->
2+
3+
<!-- 같은 레포의 이슈를 해결할 경우엔 "closes", 다른 레포의 이슈를 해결할 경우엔 "fixes", 여러 개의 이슈를 해결할 경우엔 "resolves"를 사용할 수 있습니다. -->
4+
5+
It closes #issue_number
6+
7+
# Extra info <!-- Answer 'y' or 'n'. 필요하지 않으면 지우셔도 됩니다. -->
8+
9+
# Images or Screenshots <!-- PR 변경 사항에 대한 Screenshot이나 .gif 파일 -->
10+
11+
# Further Work <!-- PR 이후 개설할 이슈 목록 -->
12+
13+
- Do something...
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build docker image on push to develop
2+
3+
on:
4+
push:
5+
branches: ["develop"]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Docker Buildx
13+
uses: docker/setup-buildx-action@v3
14+
- name: Cache Docker layers
15+
uses: actions/cache@v3
16+
with:
17+
path: /tmp/.buildx-cache
18+
key: ${{ runner.os }}-buildx-${{ github.sha }}
19+
restore-keys: |
20+
${{ runner.os }}-buildx-
21+
- name: Log in to GitHub Container Registry
22+
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
23+
- name: Build and push Image
24+
id: docker-build
25+
uses: docker/build-push-action@v5
26+
env:
27+
IMAGE_TAG: dev
28+
with:
29+
push: true
30+
tags: "ghcr.io/sparcs-kaist/zabo-front:${{ env.IMAGE_TAG }}"
31+
cache-from: type=local,src=/tmp/.buildx-cache
32+
cache-to: type=local,dest=/tmp/.buildx-cache-new
33+
- name: Remove old cache
34+
run: |
35+
rm -rf /tmp/.buildx-cache
36+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/dev-deploy.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to dev server
2+
3+
# when dev image build action is completed, run this action
4+
on:
5+
workflow_run:
6+
workflows: ["Build docker image on push to develop"]
7+
types:
8+
- completed
9+
10+
jobs:
11+
if_workflow_success:
12+
name: Deploy to dev server
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
16+
steps:
17+
- name: pull the image and restart the container
18+
uses: appleboy/[email protected]
19+
with:
20+
host: ${{ secrets.DEV_HOST }}
21+
port: ${{ secrets.DEV_PORT }}
22+
username: ${{ secrets.DEV_USERNAME }}
23+
password: ${{ secrets.DEV_PASSWORD }}
24+
proxy_host: ${{ secrets.DEV_PROXY_HOST }}
25+
proxy_port: ${{ secrets.DEV_PROXY_PORT }}
26+
proxy_username: ${{ secrets.DEV_PROXY_USERNAME }}
27+
proxy_password: ${{ secrets.DEV_PROXY_PASSWORD }}
28+
script_stop: true # stop script if any command has failed
29+
script: |
30+
docker pull ghcr.io/sparcs-kaist/zabo-front:dev
31+
docker rm -f zabo-front
32+
docker run --restart always -d -p ${{ secrets.DEV_CONTAINER_PORT }}:80 --name zabo-front ghcr.io/sparcs-kaist/zabo-front:dev
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build docker image on release tag created
2+
3+
on:
4+
push:
5+
tags:
6+
- v**
7+
8+
jobs:
9+
build:
10+
name: Build and push Image to GitHub Container Registry
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
- name: Cache Docker layers
17+
uses: actions/cache@v3
18+
with:
19+
path: /tmp/.buildx-cache
20+
key: ${{ runner.os }}-buildx-${{ github.sha }}
21+
restore-keys: |
22+
${{ runner.os }}-buildx-
23+
- name: Log in to GitHub Container Registry
24+
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
25+
- name: Build and push Image
26+
id: docker-build
27+
uses: docker/build-push-action@v5
28+
env:
29+
IMAGE_TAG: ${{github.ref_name}}
30+
with:
31+
push: true
32+
tags: |
33+
"ghcr.io/sparcs-kaist/zabo-front:${{ env.IMAGE_TAG }}"
34+
"ghcr.io/sparcs-kaist/zabo-front:latest"
35+
cache-from: type=local,src=/tmp/.buildx-cache
36+
cache-to: type=local,dest=/tmp/.buildx-cache-new
37+
- name: Remove old cache
38+
run: |
39+
rm -rf /tmp/.buildx-cache
40+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/prod-deploy.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to prod server
2+
3+
# when prod image build action is completed, run this action
4+
on:
5+
workflow_run:
6+
workflows: ["Build docker image on release tag created"]
7+
types:
8+
- completed
9+
10+
jobs:
11+
if_workflow_success:
12+
name: Deploy to dev server
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
16+
steps:
17+
- name: pull the image and restart the container
18+
uses: appleboy/[email protected]
19+
with:
20+
host: ${{ secrets.PROD_HOST }}
21+
port: ${{ secrets.PROD_PORT }}
22+
username: ${{ secrets.PROD_USERNAME }}
23+
password: ${{ secrets.PROD_PASSWORD }}
24+
proxy_host: ${{ secrets.PROD_PROXY_HOST }}
25+
proxy_port: ${{ secrets.PROD_PROXY_PORT }}
26+
proxy_username: ${{ secrets.PROD_PROXY_USERNAME }}
27+
proxy_password: ${{ secrets.PROD_PROXY_PASSWORD }}
28+
script_stop: true # stop script if any command has failed
29+
script: |
30+
docker pull ghcr.io/sparcs-kaist/zabo-front:latest
31+
docker rm -f zabo-front
32+
docker run --restart always -d -p ${{ secrets.PROD_CONTAINER_PORT }}:80 --name zabo-front ghcr.io/sparcs-kaist/zabo-front:latest

0 commit comments

Comments
 (0)