Skip to content

Commit 1a9a5d6

Browse files
committed
Move doc site into own repo
1 parent 463c7c0 commit 1a9a5d6

180 files changed

Lines changed: 10328 additions & 0 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ORIGIN="http://localhost:5173"
2+
PUBLIC_HOST_URL="http://localhost:5173"
3+
4+
# Automatically populated by the build process (don't change this)
5+
PUBLIC_COMMIT_HASH="2be04a2"

.github/actions/setup/action.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Setup
2+
description: Setup pnpm cache
3+
input:
4+
output:
5+
runs:
6+
using: 'composite'
7+
steps:
8+
- name: Install Node.js
9+
uses: actions/setup-node@v4
10+
with:
11+
node-version: 20
12+
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v2
15+
with:
16+
version: 10
17+
run_install: false
18+
19+
- name: Get pnpm store directory
20+
shell: bash
21+
run: |
22+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
23+
24+
- name: Setup pnpm cache
25+
uses: actions/cache@v4
26+
with:
27+
path: ${{ env.STORE_PATH }}
28+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-pnpm-store-
31+
32+
- name: Make dummy env for types
33+
shell: bash
34+
working-directory: ./site
35+
run: |
36+
echo "ls -a ."
37+
ls -a .
38+
cp .env.example .env
39+
echo "PUBLIC_COMMIT_HASH=${{ github.sha }}" >> .env
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
install:
10+
name: Install Dependencies
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Tools & Cache
17+
uses: ./.github/actions/setup
18+
19+
# Cache the installed node_modules directory
20+
- name: Cache node_modules
21+
uses: actions/cache@v4
22+
id: node_modules_cache_id
23+
with:
24+
path: site/node_modules
25+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
26+
27+
# If the cache didn't exist, run pnpm install
28+
- name: Install dependencies
29+
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
30+
working-directory: ./site
31+
run: pnpm install
32+
build:
33+
name: Build
34+
runs-on: ubuntu-latest
35+
needs: install
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Setup
41+
uses: ./.github/actions/setup
42+
43+
- name: Restore node_modules from cache
44+
uses: actions/cache@v4
45+
with:
46+
path: site/node_modules
47+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
48+
49+
- name: Create .env file
50+
working-directory: ./site
51+
run: |
52+
echo "ORIGIN=https://skyblockrepo.com" > .env
53+
echo "PUBLIC_HOST_URL=https://skyblockrepo.com" >> .env
54+
echo "PUBLIC_COMMIT_HASH=${GITHUB_SHA::7}" >> .env
55+
56+
- name: Build
57+
working-directory: ./site
58+
run: pnpm run build
59+
60+
- name: Upload Artifacts
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: 'site/build/'
64+
deploy:
65+
name: Deploy
66+
needs: build
67+
runs-on: ubuntu-latest
68+
69+
permissions:
70+
pages: write
71+
id-token: write
72+
73+
environment:
74+
name: github-pages
75+
url: ${{ steps.deployment.outputs.page_url }}
76+
77+
steps:
78+
- name: Deploy
79+
id: deployment
80+
uses: actions/deploy-pages@v4

.github/workflows/website.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Website
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
install:
10+
name: Install Dependencies
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Tools & Cache
17+
uses: ./.github/actions/setup
18+
19+
# Cache the installed node_modules directory
20+
- name: Cache node_modules
21+
uses: actions/cache@v4
22+
id: node_modules_cache_id
23+
with:
24+
path: site/node_modules
25+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
26+
27+
# If the cache didn't exist, run pnpm install
28+
- name: Install dependencies
29+
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
30+
working-directory: ./site
31+
run: pnpm install
32+
lint:
33+
name: Lint
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Setup
40+
uses: ./.github/actions/setup
41+
42+
- name: Restore node_modules from cache
43+
uses: actions/cache@v4
44+
with:
45+
path: site/node_modules
46+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
47+
48+
- name: Lint
49+
working-directory: ./site
50+
run: pnpm run lint
51+
check:
52+
name: Svelte Check
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Setup
59+
uses: ./.github/actions/setup
60+
61+
- name: Restore node_modules from cache
62+
uses: actions/cache@v4
63+
with:
64+
path: site/node_modules
65+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
66+
67+
- name: Check
68+
working-directory: ./site
69+
run: pnpm run check
70+
build:
71+
name: Build
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Setup
78+
uses: ./.github/actions/setup
79+
80+
- name: Restore node_modules from cache
81+
uses: actions/cache@v4
82+
with:
83+
path: site/node_modules
84+
key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }}
85+
86+
- name: Build
87+
working-directory: ./site
88+
run: pnpm run build

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
.velite
11+
12+
# OS
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Env
17+
.env
18+
.env.*
19+
!.env.example
20+
!.env.test
21+
22+
# Vite
23+
vite.config.js.timestamp-*
24+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/

.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
],
15+
"tailwindStylesheet": "./src/app.css"
16+
}

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM node:24-alpine AS builder
2+
RUN npm install -g pnpm@10.12.4
3+
WORKDIR /app
4+
5+
COPY package*.json .
6+
COPY pnpm-lock.yaml .
7+
RUN pnpm install
8+
COPY . .
9+
10+
# Set the commit hash as an environment variable
11+
ARG PUBLIC_COMMIT_HASH
12+
ENV PUBLIC_COMMIT_HASH=$PUBLIC_COMMIT_HASH
13+
14+
# Generates the oss.txt license file for used software
15+
RUN pnpm run license
16+
RUN pnpm run build
17+
RUN pnpm prune --production
18+
19+
20+
FROM node:24-alpine
21+
RUN npm install -g pnpm@10.12.4
22+
WORKDIR /app
23+
24+
ENV PUBLIC_COMMIT_HASH=$PUBLIC_COMMIT_HASH
25+
26+
COPY --from=builder /app/node_modules node_modules/
27+
COPY --from=builder /app/build build/
28+
COPY package.json .
29+
COPY pnpm-lock.yaml .
30+
31+
EXPOSE 3000
32+
ENV NODE_ENV=production
33+
CMD ["pnpm", "run", "deploy"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Docs
2+
23
The documentation site https://skyblockrepo.com

0 commit comments

Comments
 (0)