From e54ae32960555fe4c061d786ff979b972464adf7 Mon Sep 17 00:00:00 2001 From: wancat Date: Tue, 22 Aug 2023 11:16:37 +0800 Subject: [PATCH 1/8] feat: add frontend nginx image --- .dockerignore | 5 +++-- app/Dockerfile | 14 ++++++++++++++ app/src/utils/api.js | 2 +- app/vite.config.js | 3 +-- deployment/nginx.conf | 21 +++++++++++++++++++++ docker-compose.prod.yml | 11 ++++++++++- 6 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 app/Dockerfile create mode 100644 deployment/nginx.conf diff --git a/.dockerignore b/.dockerignore index d992b0f..d571957 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ -node_modules -.git \ No newline at end of file +*/node_modules +.git +*/dist \ No newline at end of file diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..dd77845 --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,14 @@ +# Build stage +FROM node as build-stage +WORKDIR /app +COPY app/package.json yarn.lock ./ +RUN yarn install +COPY app . +RUN yarn build + +# Production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY deployment/nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/app/src/utils/api.js b/app/src/utils/api.js index f598681..67ad944 100644 --- a/app/src/utils/api.js +++ b/app/src/utils/api.js @@ -1,7 +1,7 @@ import axios from 'axios' const api = axios.create({ - baseURL: '/api', + baseURL: '/api/v1', }) export default api diff --git a/app/vite.config.js b/app/vite.config.js index 2683207..133a5f9 100644 --- a/app/vite.config.js +++ b/app/vite.config.js @@ -7,9 +7,8 @@ export default defineConfig({ server: { proxy: { '/api': { - target: `${process.env.API_TARGET || 'http://localhost:3000'}/api/v1`, + target: process.env.API_TARGET || 'http://localhost:3000', changeOrigin: true, - rewrite: (path) => path.replace(/^\/api/, ''), }, '/socket.io': { target: process.env.API_TARGET || 'ws://localhost:3000', diff --git a/deployment/nginx.conf b/deployment/nginx.conf new file mode 100644 index 0000000..7a58af6 --- /dev/null +++ b/deployment/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_pass http://backend:3000; + } + + location /socket.io/ { + proxy_pass http://backend:3000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + } +} diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 4644ef6..b04ebb8 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,11 +1,20 @@ version: '3' services: app: + image: lancatlin/linux-odyssey:app + build: + context: . + dockerfile: app/Dockerfile + networks: + internal: + ports: + - 8080:80 + backend: image: lancatlin/linux-odyssey restart: on-failure build: context: . - dockerfile: Dockerfile + dockerfile: server/Dockerfile networks: - internal - players From 9aa9367f9e427b514c329ec2cecda374419d8783 Mon Sep 17 00:00:00 2001 From: wancat Date: Tue, 22 Aug 2023 11:48:44 +0800 Subject: [PATCH 2/8] refactor: move quests out of server + move quests from server/quests to ./quests + add frontend image in docker compose development --- app/Dockerfile.dev | 7 +++++++ app/package.json | 1 + docker-compose.build.yml | 2 +- docker-compose.prod.yml | 2 +- docker-compose.yml | 16 ++++++++++++++-- inspect.sh | 2 +- {server/quests => quests}/characters.yml | 0 {server/quests => quests}/helloworld/Dockerfile | 2 +- {server/quests => quests}/helloworld/README.md | 0 {server/quests => quests}/helloworld/game.yml | 0 {server/quests => quests}/helloworld/home/.zshrc | 0 .../helloworld/home/forgotten_scroll.txt | 0 {server/quests => quests}/helloworld/story.md | 0 Dockerfile => server/Dockerfile | 7 ++----- Dockerfile.dev => server/Dockerfile.dev | 5 +---- server/src/utils/docker.js | 4 ++-- yarn.lock | 2 +- 17 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 app/Dockerfile.dev rename {server/quests => quests}/characters.yml (100%) rename {server/quests => quests}/helloworld/Dockerfile (89%) rename {server/quests => quests}/helloworld/README.md (100%) rename {server/quests => quests}/helloworld/game.yml (100%) rename {server/quests => quests}/helloworld/home/.zshrc (100%) rename {server/quests => quests}/helloworld/home/forgotten_scroll.txt (100%) rename {server/quests => quests}/helloworld/story.md (100%) rename Dockerfile => server/Dockerfile (65%) rename Dockerfile.dev => server/Dockerfile.dev (73%) diff --git a/app/Dockerfile.dev b/app/Dockerfile.dev new file mode 100644 index 0000000..61d9568 --- /dev/null +++ b/app/Dockerfile.dev @@ -0,0 +1,7 @@ +FROM node + +WORKDIR /app +COPY app/package.json yarn.lock ./ +RUN yarn install --frozen-lockfile +COPY app . +CMD [ "yarn", "dev:docker", "--host", "0.0.0.0" ] \ No newline at end of file diff --git a/app/package.json b/app/package.json index bd2350a..ed916cd 100644 --- a/app/package.json +++ b/app/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "API_TARGET=https://odyssey.wancat.cc vite", "dev:local": "vite", + "dev:docker": "API_TARGET=http://backend:3000 vite", "build": "vite build", "preview": "vite preview" }, diff --git a/docker-compose.build.yml b/docker-compose.build.yml index c3bcd77..2c80ffd 100644 --- a/docker-compose.build.yml +++ b/docker-compose.build.yml @@ -4,4 +4,4 @@ services: image: lancatlin/linux-odyssey:helloworld build: context: . - dockerfile: server/quests/helloworld/Dockerfile + dockerfile: quests/helloworld/Dockerfile diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index b04ebb8..adc0808 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -10,7 +10,7 @@ services: ports: - 8080:80 backend: - image: lancatlin/linux-odyssey + image: lancatlin/linux-odyssey:backend restart: on-failure build: context: . diff --git a/docker-compose.yml b/docker-compose.yml index 40925c6..86738ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,20 @@ version: '3' services: app: + build: + context: . + dockerfile: app/Dockerfile.dev + ports: + - 5173:5173 + networks: + - internal + volumes: + - ./app/src:/app/src + backend: restart: on-failure build: context: . - dockerfile: Dockerfile.dev + dockerfile: server/Dockerfile.dev networks: - internal - players @@ -12,7 +22,9 @@ services: - '3000:3000' volumes: - /var/run/docker.sock:/var/run/docker.sock - - ./server:/app/server + - ./server/src:/app/src + - ./server/swagger.yaml:/app/swagger.yaml + - ./quests:/app/quests environment: - MONGO_URL=mongodb://db:27017/odyssey-test - DOCKER_NETWORK=linux-odyssey-players diff --git a/inspect.sh b/inspect.sh index 7f3c41d..8672b12 100755 --- a/inspect.sh +++ b/inspect.sh @@ -1,2 +1,2 @@ #!/bin/sh -docker compose logs app -f --no-log-prefix +docker compose -f docker-compose.prod.yml logs backend -f --no-log-prefix diff --git a/server/quests/characters.yml b/quests/characters.yml similarity index 100% rename from server/quests/characters.yml rename to quests/characters.yml diff --git a/server/quests/helloworld/Dockerfile b/quests/helloworld/Dockerfile similarity index 89% rename from server/quests/helloworld/Dockerfile rename to quests/helloworld/Dockerfile index cd7b038..ce97fea 100644 --- a/server/quests/helloworld/Dockerfile +++ b/quests/helloworld/Dockerfile @@ -22,6 +22,6 @@ USER rudeus WORKDIR /home/rudeus -COPY ./server/quests/helloworld/home /home/rudeus/ +COPY ./quests/helloworld/home /home/rudeus/ CMD [ "/bin/zsh" ] diff --git a/server/quests/helloworld/README.md b/quests/helloworld/README.md similarity index 100% rename from server/quests/helloworld/README.md rename to quests/helloworld/README.md diff --git a/server/quests/helloworld/game.yml b/quests/helloworld/game.yml similarity index 100% rename from server/quests/helloworld/game.yml rename to quests/helloworld/game.yml diff --git a/server/quests/helloworld/home/.zshrc b/quests/helloworld/home/.zshrc similarity index 100% rename from server/quests/helloworld/home/.zshrc rename to quests/helloworld/home/.zshrc diff --git a/server/quests/helloworld/home/forgotten_scroll.txt b/quests/helloworld/home/forgotten_scroll.txt similarity index 100% rename from server/quests/helloworld/home/forgotten_scroll.txt rename to quests/helloworld/home/forgotten_scroll.txt diff --git a/server/quests/helloworld/story.md b/quests/helloworld/story.md similarity index 100% rename from server/quests/helloworld/story.md rename to quests/helloworld/story.md diff --git a/Dockerfile b/server/Dockerfile similarity index 65% rename from Dockerfile rename to server/Dockerfile index a3a1f79..6ee9ddd 100644 --- a/Dockerfile +++ b/server/Dockerfile @@ -1,15 +1,12 @@ FROM node WORKDIR /app -COPY package.json yarn.lock ./ -COPY server/package.json ./server/ +COPY server/package.json yarn.lock ./ RUN yarn install --frozen-lockfile --production -WORKDIR /app/server - COPY server/src ./src -COPY server/quests ./quests COPY server/swagger.yaml . +COPY quests ./quests ENV NODE_ENV=production ENV HOST=0.0.0.0 diff --git a/Dockerfile.dev b/server/Dockerfile.dev similarity index 73% rename from Dockerfile.dev rename to server/Dockerfile.dev index 43b79ff..aad80cb 100644 --- a/Dockerfile.dev +++ b/server/Dockerfile.dev @@ -1,12 +1,9 @@ FROM node WORKDIR /app -COPY package.json yarn.lock ./ -COPY server/package.json ./server/ +COPY server/package.json yarn.lock ./ RUN yarn install --frozen-lockfile -WORKDIR /app/server - ARG DOCKER_GID=140 RUN groupadd -g $DOCKER_GID docker && usermod -aG docker node diff --git a/server/src/utils/docker.js b/server/src/utils/docker.js index af6c634..66eb627 100644 --- a/server/src/utils/docker.js +++ b/server/src/utils/docker.js @@ -17,7 +17,7 @@ const containerOptions = { Binds: config.isProduction ? [] : [ - `${projectPath}/server/quests/helloworld/home:/home/rudeus`, + `${projectPath}/quests/helloworld/home:/home/rudeus`, `${projectPath}/packages/container:/usr/local/lib/container`, ], }, @@ -60,7 +60,7 @@ export async function attachContainer(container, { token }) { AttachStderr: true, Cmd: ['/bin/zsh'], Tty: true, - Env: [`TOKEN=${token}`, `API_ENDPOINT=http://app:3000`], + Env: [`TOKEN=${token}`, `API_ENDPOINT=http://backend:3000`], }) const execOutput = await exec.start({ diff --git a/yarn.lock b/yarn.lock index 264332c..0ed3bfe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4269,7 +4269,7 @@ socket.io-adapter@~2.5.2: dependencies: ws "~8.11.0" -socket.io-client@^4.7.2: +socket.io-client@^4.7.1, socket.io-client@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.2.tgz#f2f13f68058bd4e40f94f2a1541f275157ff2c08" integrity sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w== From d8f8605df92fba7d3faecde802787f9a49f14007 Mon Sep 17 00:00:00 2001 From: wancat Date: Tue, 22 Aug 2023 12:11:58 +0800 Subject: [PATCH 3/8] fix: deployment + include api-docs in nginx + include quests in docker compose + update README --- README.md | 82 ++++++++++++++++------------------------ deployment/nginx.conf | 4 ++ docker-compose.build.yml | 7 ---- docker-compose.prod.yml | 8 +++- docker-compose.yml | 6 +++ 5 files changed, 48 insertions(+), 59 deletions(-) delete mode 100644 docker-compose.build.yml diff --git a/README.md b/README.md index 58467aa..63ecaaa 100644 --- a/README.md +++ b/README.md @@ -8,76 +8,58 @@ ## Installation -``` -git clone https://github.com/lancatlin/linux-odyssey.git -cd linux-odyssey -yarn install -``` + git clone https://github.com/lancatlin/linux-odyssey.git + cd linux-odyssey + yarn install -## Create database +## Developement -``` -docker compose pull -docker compose up -d db -``` - -## Server - -Source: `server/` - -``` -docker compose -f docker-compose.build.yml pull -docker compose up -d -# Open http://localhost:3000 -``` - -### Build images +Run everything (frontend, backend, db, swagger, quests): docker compose build - docker compose push + docker compose up -d -Game images: +### Deployment -``` -docker compose -f docker-compose.build.yml build -docker compose -f docker-compose.build.yml push -``` + docker compose -f docker-compose.prod.yml build + docker compose -f docker-compose.prod.yml push -## App + # Server side + docker compose -f docker-compose.prod.yml pull + docker compose -f docker-compose.prod.yml up -d + +## Standalone App (without Docker) Source: `app/` -``` -# Connect to dev server (https://odyssey.wancat.cc) -yarn app + # Connect to dev server (https://odyssey.wancat.cc) + yarn app -# Connect to localhost (http://localhost:3000) -yarn app:local -``` + # Connect to localhost (http://localhost:3000) + yarn app:local + + # Connect to anyhost + API_ENDPOINT=http://example.com yarn app:local ## Swagger -``` -docker compose up -d swagger -``` + docker compose up -d swagger Open http://localhost:8080 to open Swagger -## CLI terminal client +## CLI terminal client (Docker not required) -``` -yarn cli -Usage: client [options] [command] + yarn cli + Usage: client [options] [command] -Options: - -s, --session Session ID - -c, --create Create a new session - -h, --host Server host (default: "http://localhost:3000") - --help display help for command + Options: + -s, --session Session ID + -c, --create Create a new session + -h, --host Server host (default: "http://localhost:3000") + --help display help for command -Commands: - list List all sessions -``` + Commands: + list List all sessions connet to recent session: diff --git a/deployment/nginx.conf b/deployment/nginx.conf index 7a58af6..278bcb1 100644 --- a/deployment/nginx.conf +++ b/deployment/nginx.conf @@ -11,6 +11,10 @@ server { proxy_pass http://backend:3000; } + location /api-docs/ { + proxy_pass http://backend:3000; + } + location /socket.io/ { proxy_pass http://backend:3000; proxy_http_version 1.1; diff --git a/docker-compose.build.yml b/docker-compose.build.yml deleted file mode 100644 index 2c80ffd..0000000 --- a/docker-compose.build.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: '3' -services: - helloworld: - image: lancatlin/linux-odyssey:helloworld - build: - context: . - dockerfile: quests/helloworld/Dockerfile diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index adc0808..e448dad 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -18,8 +18,6 @@ services: networks: - internal - players - ports: - - '3000:3000' volumes: - /var/run/docker.sock:/var/run/docker.sock environment: @@ -42,6 +40,12 @@ services: - MONGO_PASS=user-password - MONGO_DB=odyssey-test + helloworld: + image: lancatlin/linux-odyssey:helloworld + build: + context: . + dockerfile: quests/helloworld/Dockerfile + networks: internal: players: diff --git a/docker-compose.yml b/docker-compose.yml index 86738ef..9e15ab5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,12 @@ services: environment: - SWAGGER_FILE=/tmp/swagger.yaml + helloworld: + image: lancatlin/linux-odyssey:helloworld + build: + context: . + dockerfile: quests/helloworld/Dockerfile + networks: internal: players: From eeb30d1f7a2b90e2e4ee1f7890ae8f517e94cea6 Mon Sep 17 00:00:00 2001 From: "Lin, Hung-Shin" Date: Tue, 22 Aug 2023 12:17:47 +0800 Subject: [PATCH 4/8] fix: Update README.md typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 63ecaaa..1ae540c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ cd linux-odyssey yarn install -## Developement +## Development Run everything (frontend, backend, db, swagger, quests): From cf5b761f3fce6d80de317423ffed0d8af9880f05 Mon Sep 17 00:00:00 2001 From: wancat Date: Tue, 22 Aug 2023 15:49:21 +0800 Subject: [PATCH 5/8] feat: collect docker scripts into one file --- cleanup.sh | 5 ----- docker-scripts.sh | 17 +++++++++++++++++ inspect.sh | 2 -- 3 files changed, 17 insertions(+), 7 deletions(-) delete mode 100755 cleanup.sh create mode 100755 docker-scripts.sh delete mode 100755 inspect.sh diff --git a/cleanup.sh b/cleanup.sh deleted file mode 100755 index 09c66ad..0000000 --- a/cleanup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -containers=$(docker ps -a | grep 'quest-' | awk '{print $1}') -echo $containers - -docker rm -f $containers \ No newline at end of file diff --git a/docker-scripts.sh b/docker-scripts.sh new file mode 100755 index 0000000..89cea7b --- /dev/null +++ b/docker-scripts.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +inspect() { + # default to app, allow overriding by $1 + SERVICE=${1:-app} + echo "Running docker-compose logs for service [$SERVICE]..." + docker compose logs $SERVICE -f --no-log-prefix +} + +clean() { + containers=$(docker ps -a | grep 'quest-' | awk '{print $1}') + echo $containers + + docker rm -f $containers +} + +$@ \ No newline at end of file diff --git a/inspect.sh b/inspect.sh deleted file mode 100755 index 8672b12..0000000 --- a/inspect.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -docker compose -f docker-compose.prod.yml logs backend -f --no-log-prefix From 4b3a80608c93fa15048570df4a1192b7d4a91e0d Mon Sep 17 00:00:00 2001 From: wancat Date: Tue, 22 Aug 2023 16:05:06 +0800 Subject: [PATCH 6/8] fix: remove hard coded project path + pass host_pwd using docker compose + mount it only when provided --- docker-compose.yml | 1 + server/src/api/socket.js | 2 +- server/src/config.js | 1 + server/src/{utils => containers}/docker.js | 15 +++++++-------- 4 files changed, 10 insertions(+), 9 deletions(-) rename server/src/{utils => containers}/docker.js (84%) diff --git a/docker-compose.yml b/docker-compose.yml index 9e15ab5..8c27a73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,7 @@ services: environment: - MONGO_URL=mongodb://db:27017/odyssey-test - DOCKER_NETWORK=linux-odyssey-players + - HOST_PWD=${PWD} db: image: mongo restart: always diff --git a/server/src/api/socket.js b/server/src/api/socket.js index 7e167ae..a56fcb8 100644 --- a/server/src/api/socket.js +++ b/server/src/api/socket.js @@ -1,5 +1,5 @@ import { Server } from 'socket.io' -import { getOrCreateContainer, attachContainer } from '../utils/docker.js' +import { getOrCreateContainer, attachContainer } from '../containers/docker.js' import Session from '../models/session.js' import { defaultUser, genSessionJWT } from '../utils/auth.js' diff --git a/server/src/config.js b/server/src/config.js index 6b3abf0..5e969da 100644 --- a/server/src/config.js +++ b/server/src/config.js @@ -7,4 +7,5 @@ export default { jwtSecret: get('JWT_SECRET', 'secret'), dockerNetwork: get('DOCKER_NETWORK', 'linux-odyssey-players'), isProduction: process.env.NODE_ENV === 'production', + hostPwd: get('HOST_PWD', ''), } diff --git a/server/src/utils/docker.js b/server/src/containers/docker.js similarity index 84% rename from server/src/utils/docker.js rename to server/src/containers/docker.js index 66eb627..f4a2493 100644 --- a/server/src/utils/docker.js +++ b/server/src/containers/docker.js @@ -3,8 +3,6 @@ import config from '../config.js' const engine = new Docker() -const projectPath = '/home/zeko/src/linux-odyssey' - const containerOptions = { Image: 'lancatlin/linux-odyssey:helloworld', AttachStdin: true, @@ -14,12 +12,13 @@ const containerOptions = { OpenStdin: true, StdinOnce: false, HostConfig: { - Binds: config.isProduction - ? [] - : [ - `${projectPath}/quests/helloworld/home:/home/rudeus`, - `${projectPath}/packages/container:/usr/local/lib/container`, - ], + Binds: + config.isProduction && config.hostPwd + ? [] + : [ + `${config.hostPwd}/quests/helloworld/home:/home/rudeus`, + `${config.hostPwd}/packages/container:/usr/local/lib/container`, + ], }, } From 280e2464303afb52daaa25980d1ed5a689b1334f Mon Sep 17 00:00:00 2001 From: wancat Date: Wed, 23 Aug 2023 10:50:31 +0800 Subject: [PATCH 7/8] feat: build backend, frontend, and quest images in workflow --- .github/workflows/ci_cd.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 46e6ad1..c240cd8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -19,12 +19,29 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Docker image + - name: Build backend uses: docker/build-push-action@v2 with: context: . + file: ./server/Dockerfile push: true - tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:latest + tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:backend + + - name: Build app + uses: docker/build-push-action@v2 + with: + context: . + file: ./app/Dockerfile + push: true + tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:app + + - name: Build quest helloworld + uses: docker/build-push-action@v2 + with: + context: . + file: ./quests/helloworld/Dockerfile + push: true + tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:helloworld deploy: needs: build-and-push From 268f9fe4b13c1c284621bd9160d0a2aa44957de2 Mon Sep 17 00:00:00 2001 From: wancat Date: Wed, 23 Aug 2023 10:56:21 +0800 Subject: [PATCH 8/8] feat: add eslint workflow --- .eslintignore | 3 ++- .github/workflows/eslint.yml | 22 ++++++++++++++++++++++ .prettierignore | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/eslint.yml diff --git a/.eslintignore b/.eslintignore index 7172e54..8aace4d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ vite.config.js .gitignore data -mongo-init.js \ No newline at end of file +mongo-init.js +app/dist \ No newline at end of file diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..01f475e --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,22 @@ +name: ESLint Checks + +on: + push: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install dependencies + run: yarn install + + - name: Lint + run: yarn lint diff --git a/.prettierignore b/.prettierignore index 07f43b8..678ec4e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -data/* \ No newline at end of file +data/* +app/dist \ No newline at end of file