Skip to content

Commit 2c16c6a

Browse files
Default docusaurus site. Add github workflows for deployment of documentation to github pages on push. Restructure project. Nice monorepo.
1 parent 9314e81 commit 2c16c6a

71 files changed

Lines changed: 15525 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy documentation site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
working-directory: ./website
11+
12+
jobs:
13+
build:
14+
name: Build Docusaurus
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: pnpm/action-setup@v4
21+
name: Install pnpm
22+
with:
23+
version: 10
24+
run_install: false
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: pnpm i
32+
- name: Build website
33+
run: pnpm run build
34+
35+
- name: Upload Build Artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: build
39+
40+
deploy:
41+
name: Deploy to GitHub Pages
42+
needs: build
43+
44+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
45+
permissions:
46+
pages: write # to deploy to Pages
47+
id-token: write # to verify the deployment originates from an appropriate source
48+
49+
# Deploy to the github-pages environment
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test documentation site deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
working-directory: ./website
11+
12+
jobs:
13+
test-deploy:
14+
name: Test deployment
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: pnpm/action-setup@v4
21+
name: Install pnpm
22+
with:
23+
version: 10
24+
run_install: false
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: npm
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
- name: Test build website
33+
run: npm run build

bot/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CLIENT_ID=
2+
DISCORD_TOKEN=
3+
4+
# There's a daily limit on how many commands you can deploy.
5+
SKIP_DEPLOY_COMMANDS=0
6+
NODE_ENV=production

bot/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
.env
3+
!.env.example
4+
build/
5+
*.db

bot/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:alpine AS base
2+
ENV PNPM_HOME="/pnpm"
3+
ENV PATH="$PNPM_HOME:$PATH"
4+
RUN corepack enable
5+
COPY . /app
6+
WORKDIR /app
7+
8+
FROM base AS prod-deps
9+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
10+
11+
FROM base AS build
12+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
13+
RUN pnpm run build
14+
15+
FROM base
16+
COPY --from=prod-deps /app/node_modules /app/node_modules
17+
COPY --from=build /app/build /app/build
18+
19+
CMD [ "pnpm", "start" ]

bot/biome.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "space",
14+
"indentWidth": 4,
15+
"lineWidth": 101
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true
21+
}
22+
},
23+
"javascript": {
24+
"formatter": {
25+
"quoteStyle": "double"
26+
}
27+
},
28+
"assist": {
29+
"enabled": true,
30+
"actions": {
31+
"source": {
32+
"organizeImports": "on"
33+
}
34+
}
35+
}
36+
}

bot/compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
meibot:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
env_file: .env
7+
restart: always
8+
volumes:
9+
- ./bot_data.db:/app/bot_data.db

bot/package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"type": "module",
3+
"name": "set_reporter",
4+
"version": "0.1.0",
5+
"description": "Discord bot to report set results",
6+
"main": "index.js",
7+
"scripts": {
8+
"start": "node build/index.js",
9+
"start:env": "node --env-file=.env build/index.js",
10+
"dev": "tsx --env-file=.env src/index.ts",
11+
"build": "esbuild src/index.ts --bundle --packages=external --platform=node --target=node24 --outdir=build --format=esm",
12+
"test": "vitest",
13+
"check": "biome check src/",
14+
"lint": "biome lint src/"
15+
},
16+
"dependencies": {
17+
"better-sqlite3": "^12.4.1",
18+
"discord-api-types": "^0.38.33",
19+
"discord.js": "^14.24.2",
20+
"knex": "^3.1.0",
21+
"pino": "^9.14.0",
22+
"zod": "^4.1.12"
23+
},
24+
"devDependencies": {
25+
"@biomejs/biome": "2.2.4",
26+
"esbuild": "^0.25.12",
27+
"tsx": "^4.20.6",
28+
"typescript": "^5.9.3",
29+
"vite-tsconfig-paths": "^5.1.4",
30+
"vitest": "^3.2.4"
31+
}
32+
}

0 commit comments

Comments
 (0)