Skip to content

Commit

Permalink
Merge branch 'main' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyhuman committed Jun 24, 2023
2 parents 1a4351c + e596921 commit 2683c10
Show file tree
Hide file tree
Showing 12 changed files with 936 additions and 43 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node.js CI

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

jobs:
build:
runs-on: ubuntu-latest
container: node:10.18-jessie
services:
postgres:
image: postgres:13-alpine

env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: thestack
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [16.x]
env:
# these could also come from env variables of the actions if you wish for them to
DATABASE_URL: 'postgresql://postgres:postgres@postgres:5432/tillwhen?schema=public'
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v2
with:
version: 8.3.1

- run: pnpm install --frozen-lockfile
# TODO: Enable after you have defined migrations in your codebase using prisma
# - run: pnpx prisma migrate deploy
- run: pnpm test:ci
11 changes: 5 additions & 6 deletions .github/workflows/docs-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@ jobs:
install linux-amd64/mudkip /usr/local/bin
- name: Build
run: |
mudkip -baseurl="/thestack" -o='docs_dist' --stylesheet='docs/styles.css'
mudkip --baseurl="/thestack/" -o='docs_dist' --stylesheet='docs/styles.css'
- uses: actions/upload-pages-artifact@v1
with:
path: "./docs_dist"

path: './docs_dist'

# Deploy job
deploy:
# Add a dependency to the build job
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "decorator-mvc",
"name": "tillwhen-backend",
"version": "1.0.0",
"main": "index.js",
"packageManager": "pnpm@8.3.1",
Expand All @@ -8,12 +8,14 @@
"dev:worker": "npx tsnd --exit-child -r tsconfig-paths/register src/worker.ts",
"start": "npx ts-node --transpileOnly -r tsconfig-paths/register src/server.ts",
"test:types": "tsc",
"fix": "npx pretty-quick",
"test": "vitest ./tests",
"fix": "npx prettier --write .",
"test": "cross-env NODE_ENV=TEST vitest ./tests",
"test:ci": "cross-env NODE_ENV=TEST vitest run ./tests",
"db:migrate": "npx prisma migrate deploy",
"db:reset": "npx prisma migrate reset",
"db:push": "npx prisma db push",
"db:make:migration": "npx prisma migrate dev"
"db:make:migration": "npx prisma migrate dev",
"prepare": "husky install"
},
"prettier": "@barelyhuman/prettier-config",
"license": "MIT",
Expand All @@ -22,15 +24,21 @@
"body-parser": "^1.20.2",
"bull": "^4.10.4",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"date-fns": "^2.30.0",
"defu": "^6.1.2",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-edge": "3",
"express-jsdoc-swagger": "^1.8.0",
"express-limiter": "^1.6.1",
"helmet": "^7.0.0",
"ioredis": "^5.3.2",
"jsonwebtoken": "^9.0.0",
"morgan": "^1.10.0",
"ms": "^2.1.3",
"nodemailer": "^6.9.3",
"preact": "^10.15.1",
"preact-render-to-string": "^6.1.0",
"serve-static": "^1.15.0"
Expand All @@ -40,6 +48,10 @@
"@types/express": "^4.17.17",
"@types/node": "^20.3.1",
"axios": "^1.4.0",
"cross-env": "^7.0.3",
"husky": ">=7",
"ioredis-mock": "^8.7.0",
"lint-staged": ">=10",
"nodemon": "^2.0.22",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
Expand All @@ -50,5 +62,8 @@
"tsconfig-paths": "^4.2.0",
"vite": "^4.3.9",
"vitest": "^0.32.2"
},
"lint-staged": {
"*.{ts,tsx,js,css,md}": "prettier --write"
}
}
Loading

0 comments on commit 2683c10

Please sign in to comment.