Skip to content

Commit dae725d

Browse files
committed
refactor: mega cleanup, monorepo setup, better workflows
1 parent 98d2e85 commit dae725d

129 files changed

Lines changed: 8482 additions & 86052 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.

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# Allow files and directories
55
!go.mod
66
!go.sum
7+
!.yarnrc.yml
8+
!.yarn/releases
9+
!yarn.lock
10+
!package.json
11+
!tsconfig.json
712
!/database/**
813
!/graphql/**
914
!/server/**

.github/workflows/app.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
check:
17+
- format
18+
- type
19+
- graphql
20+
name: Check ${{ matrix.check }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
- name: Set up Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version-file: .nvmrc
29+
cache: yarn
30+
- name: Install
31+
run: yarn install
32+
- name: Check
33+
run: yarn check:${{ matrix.check }}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
name: "CodeQL analysis"
1+
name: 'CodeQL analysis'
22

33
on:
44
push:
55
branches:
66
- main
77
pull_request:
8-
types: [opened, synchronize, reopened]
98
branches:
109
- main
1110
schedule:
12-
- cron: "0 23 * * 0"
11+
- cron: '0 23 * * 0'
1312

1413
jobs:
1514
analyze:
1615
name: Analyze
1716
runs-on: ubuntu-latest
18-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1917
steps:
2018
- name: Checkout
2119
uses: actions/checkout@v3
2220
- name: Initialize
23-
uses: github/codeql-action/init@v1
21+
uses: github/codeql-action/init@v2
2422
with:
2523
languages: go, javascript
2624
- name: Perform analysis
27-
uses: github/codeql-action/analyze@v1
25+
uses: github/codeql-action/analyze@v2

.github/workflows/database.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@ on:
55
branches:
66
- main
77
pull_request:
8-
types: [opened, synchronize, reopened]
98
branches:
109
- main
1110

1211
jobs:
1312
init-check:
1413
name: Init check
1514
runs-on: ubuntu-latest
16-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1715
services:
1816
postgres:
19-
image: postgres:14
17+
image: postgres:16
2018
env:
2119
POSTGRES_PASSWORD: wowmuchsecret
2220
ports:
@@ -37,27 +35,3 @@ jobs:
3735
PGPASSWORD: wowmuchsecret
3836
POSTGRES_DB: heltin
3937
run: database/init.sh
40-
release:
41-
name: Release
42-
if: github.ref == 'refs/heads/main'
43-
needs: [init-check]
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: Checkout
47-
uses: actions/checkout@v3
48-
- name: Set up Docker Buildx
49-
uses: docker/setup-buildx-action@v2
50-
- name: Login to GitHub Container Registry
51-
uses: docker/login-action@v2
52-
with:
53-
registry: ghcr.io
54-
username: ${{ github.actor }}
55-
password: ${{ secrets.GITHUB_TOKEN }}
56-
- name: Build and push
57-
uses: docker/bake-action@v2
58-
with:
59-
set: |
60-
*.cache-from=type=gha
61-
*.cache-to=type=gha,mode=max
62-
targets: database
63-
push: true

.github/workflows/graphql.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
name: Server
1+
name: Release
22

33
on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
types: [opened, synchronize, reopened]
9-
branches:
10-
- main
7+
8+
# TODO: make sure database sql is valid before releasing
119

1210
jobs:
13-
# TODO: only release if app checks pass
1411
release:
15-
name: Release
16-
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.ref == 'refs/heads/main'"
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
target:
16+
- database
17+
- graphql
18+
- server
19+
name: Release ${{ matrix.target }}
1720
runs-on: ubuntu-latest
1821
steps:
1922
- name: Checkout
@@ -22,19 +25,19 @@ jobs:
2225
id: shortsha
2326
run: echo "shortsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
2427
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@v2
28+
uses: docker/setup-buildx-action@v3
2629
- name: Login to GitHub Container Registry
27-
uses: docker/login-action@v2
30+
uses: docker/login-action@v3
2831
with:
2932
registry: ghcr.io
3033
username: ${{ github.actor }}
3134
password: ${{ secrets.GITHUB_TOKEN }}
32-
- name: Build and push
33-
uses: docker/bake-action@v2
35+
- name: Build and Push
36+
uses: docker/bake-action@v4
3437
with:
3538
set: |
3639
*.cache-from=type=gha
3740
*.cache-to=type=gha,mode=max
3841
server.args.VITE_APP_VER=${{ steps.shortsha.outputs.shortsha }}
39-
targets: server
42+
targets: ${{ matrix.target }}
4043
push: true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v21

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.graphql*
2+
.yarn/*
3+
*/build/*

app/.prettierrc renamed to .prettierrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"printWidth": 100,
33
"singleQuote": true,
44
"trailingComma": "all",
5+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
56
"importOrder": [
67
"^react",
78
"<THIRD_PARTY_MODULES>",
@@ -11,7 +12,5 @@
1112
"^modules/(.*)$",
1213
"^assets/(.*)$",
1314
"^[./]"
14-
],
15-
"importOrderSeparation": true,
16-
"importOrderSortSpecifiers": true
15+
]
1716
}

0 commit comments

Comments
 (0)