Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

run-name: >-
${{
github.event_name == 'push' &&
format('CI: {0}', github.event.head_commit.message) ||
format('CI: {0}', github.sha)
}}

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Lint, typecheck, test
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Typecheck
run: pnpm typecheck

- name: Test
run: pnpm test
29 changes: 13 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ name: Deploy

run-name: >-
${{
github.event_name == 'workflow_run' && format('Deploy dev: {0}', github.event.workflow_run.head_commit.message) ||
github.event_name == 'release' && format('Deploy prod: {0}', github.event.release.tag_name) ||
format('Deploy dev: {0}', github.sha)
format('Deploy: {0}', github.sha)
}}

concurrency:
group: >-
deploy-${{
github.event_name == 'release' && format('prod-{0}', github.event.release.tag_name) ||
format('dev-{0}', github.ref)
github.event_name == 'workflow_run' && format('ci-{0}', github.event.workflow_run.head_branch) ||
github.ref
}}
cancel-in-progress: true

on:
push:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
release:
types: [published]
Expand All @@ -39,10 +43,16 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'release' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}

- name: Set deployment vars
id: vars
Expand Down Expand Up @@ -73,19 +83,6 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up Node.js and pnpm
uses: actions/setup-node@v4
with:
node-version: 24

- name: Install pnpm
run: corepack enable && corepack prepare pnpm@latest --activate

- name: Install and typecheck
run: |
pnpm install --frozen-lockfile
pnpm typecheck

- name: Build and push
uses: docker/build-push-action@v6
with:
Expand Down
14 changes: 13 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
"json": {
"indentWidth": 2
},
"includes": ["src/**/*.{ts,tsx}", "server.ts", "vite.config.ts", "drizzle.config.ts"],
"plugins": [
"https://plugins.dprint.dev/typescript-0.93.3.wasm",
"https://plugins.dprint.dev/json-0.19.4.wasm",
"https://plugins.dprint.dev/g-plane/malva-v0.11.0.wasm"
],
"includes": [
"src/**/*.{ts,tsx,css}",
"*.{ts,json}",
"server.ts",
"vite.config.ts",
"vitest.config.ts",
"drizzle.config.ts"
],
"excludes": ["node_modules", "dist"]
}
12 changes: 6 additions & 6 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Config } from "drizzle-kit";
import type { Config, } from 'drizzle-kit'

export default {
schema: "./src/db/schema.ts",
out: "./src/db/migrations",
dialect: "postgresql",
schema: './src/db/schema.ts',
out: './src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL ?? "postgresql://underlay:underlay@localhost:5432/underlay",
url: process.env.DATABASE_URL ?? 'postgresql://underlay:underlay@localhost:5432/underlay',
},
} satisfies Config;
} satisfies Config
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"type": "module",
"packageManager": "pnpm@10.33.3",
"scripts": {
"dev": "./dev.sh",
"dev:app": "tsx --env-file=.env.local server.ts",
Expand All @@ -19,6 +20,8 @@
"tool:restore": "tsx tools/restore.ts",
"tool:pruneBackups": "tsx tools/pruneBackups.ts",
"tool:seed-mirror": "tsx tools/seedMirror.ts",
"test": "vitest run",
"test:watch": "vitest",
"secrets:encrypt": "sops -e --input-type dotenv --output-type dotenv --output .env.enc .env",
"secrets:encrypt:dev": "sops -e --input-type dotenv --output-type dotenv --output .env.dev.enc .env.dev",
"secrets:decrypt": "sops -d --input-type dotenv --output-type dotenv --output .env .env.enc",
Expand Down Expand Up @@ -57,6 +60,7 @@
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.0",
"@testing-library/react": "^16.3.2",
"@types/bcrypt": "^6.0.0",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.0.0",
Expand All @@ -65,11 +69,21 @@
"@types/react-dom": "^19.1.0",
"@types/tar-stream": "^3.1.4",
"@vitejs/plugin-react": "^4",
"drizzle-kit": "^0.31.0",
"dprint": "latest",
"drizzle-kit": "^0.31.0",
"happy-dom": "^20.9.0",
"lint-staged": "^17.0.4",
"oxlint": "latest",
"simple-git-hooks": "^2.13.1",
"tailwindcss": "^4.1.0",
"typescript": "^6.0.0",
"vite": "^6"
"vite": "^6",
"vitest": "^4.1.6"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*.{ts,tsx,css,json}": "dprint fmt --"
}
}
Loading
Loading